p4 logexport

Export a structured server log file to an external service using the OpenTelemetry Protocol (OTLP).

Syntax

p4 g-opts logexport [-l | -e endpoint [-h headers ...] [-I interval ]] logname

Syntax conventions

Description

The command parses the named structured logfile (logname) and exports the log entries to the open-telemetry (OTLP) endpoint specified with the -e flag. The endpoint is typically a log aggregation service. The command creates an export state file for the structured log so that repeated calls for a given log continue from the most recent exported entry.

Configure this as a startup command, and set the -I interval option. This interval option determines how many milliseconds the export pauses when the end of the log has been reached. After that interval, the command automatically looks for more log entries to export.

To view the current state of a logexport, specify the -l option.

To learn more, see Structured logs in Helix Core Server Administrator Guide.

Limitation

This command originated with the 2024.2 release and works only if the Helix Core Server is running on the Linux x86_64 platform.

Options

-e endpoint

The endpoint of a log aggregation service.

-I interval Number of milliseconds to wait after the end of a log has been reached before looking for more log entries to export.

-l

Display the current state of a logexport. If the log is being exported, display up to which point has been exported. (To determine if the export process is alive, use p4 monitor.)

-h header

One or more name/value pairs added to the HTTP request headers. For example,

-h "authorization=Basic <base64("username:password")>"

logname

Name of the structured log to export.

g-opts

See Global options.

Usage notes

Can File Arguments Use Revision Specifier? Can File Arguments Use Revision Range? Minimal Access Level Required

N/A

N/A

super

available to an operator user

Examples

p4 logexport -e https://otlp-gateway-prod-us-east-0.grafana.net/otlp/v1/logs -h "authorization=Basic <base64("username:password")>"

As a startup command:

p4 configure set startup.1="logexport -I 100 -e https://otlp-gateway-prod-us-east-0.grafana.net/otlp/v1/logs -h \"authorization=Basic <base64("username:password")>\""