p4 logparse

Synopsis

Parse a structured log file and return data.

Syntax

p4 [g-opts] [-e] [-T fields…] [-F filter] [-s offset] [-m max] logfile

Description

The p4 logparse command parses the indicated structured logfile and returns the log data in tagged format.

Valid names for structured log files are:

all.csv

All loggable events (commands, errors, audit, etc.)

commands.csv

Command events (command start, command compute, command end)

errors.csv

Error events (errors-failed, errors-fatal)

audit.csv

Audit events (audit, purge)

track.csv

Command tracking (track-usage, track-rpc, track-db)

user.csv

User events; one record every time a user runs p4 logappend.

events.csv

Server events (startup, shutdown, checkpoint, journal rotation, etc.)

integrity.csv

Major events that occur during replica integrity checking.

To enable structured logging, set the serverlog.file.n configurable(s) to the name of the file. To enable all recording of all eight log types, set the following configurables:


p4 configure set serverlog.file.1=all.csv
p4 configure set serverlog.file.2=commands.csv
p4 configure set serverlog.file.3=errors.csv
p4 configure set serverlog.file.4=audit.csv
p4 configure set serverlog.file.5=track.csv
p4 configure set serverlog.file.6=user.csv
p4 configure set serverlog.file.7=events.csv
p4 configure set serverlog.file.8=integrity.csv

Structured log files are automatically rotated on checkpoint, journal creation, overflow of associated serverlog.maxmb.n limit (if configured), and the p4 logrotate command.

Options

-e

Display special characters as hex-encodings.

-F filter

limits output to records that match the filter pattern.

-m max

Limit the number of lines returned.

-s f_offset

Starts parsing at the given file offset as returned in the f_offset field.

-T fields…

Limit displayed fields to those listed.

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

  • Structured logs differ from the basic error log (P4LOG) and audit log (P4AUDIT). To read the basic error log, use the p4 logtail command.