Artifact [6fd30a03bc]
Artifact 6fd30a03bc6b22c86a0a94dfef0c23f38fa85ee1e230bc08de9d31dba575cfb2:
- File logfmt1/manpage/logex.md — part of check-in [9be300bfed] at 2021-01-03 20:06:05 on branch trunk — Stub manpage for logfmt(5) (user: mario size: 1740)
| % logex(1) logfmt1 tool | Version 0.3 |
|---|
NAME
logex — extracts fields from log files which have a .log.fmt alongside - as generated by update-logfmt(1)
SYNOPSIS
logex [file.log] [field field2 field3]
| logex [--tab | --csv | --json | --debug] [file.log] ["fields"] |
|---|
logex [--regex] [file.log]
DESCRIPTION
logex is a little command line tool around logopen().
It basically allows fetching individual fields from a log, and/or
restructuring it into a specific format (e.g. tab or comma-delimited).
logex access.log request_uri datetime user_agent
Where the first param is always the log file, and then an arbitrary number of field names - either individually or as part of a string argument:
logex access.log --tab "uri,date,status" user_agent
Would delimit the first three per comma, the last with a tab.
Options
| param | desc |
|---|---|
| --json | output each row as JSON |
| --csv | join all fields with comma |
| --tab | tab-separated output |
| --iso8601 | fix any datetime fields |
| --regex | just output regex for log |
| --debug | debug_rx in case the regex fails |
Prefixes
The argument list allows field name prefixes. Which are only relevant to container-fields (expanded key:value pairs for some application formats), in case they're holding lists.
| prefix | output |
|---|---|
| @name | will just show the first entry |
| %name | space-separated list |
| *name | comma-separated list |
| +name | plus-joined list |
| #name | as json array |
| name | whatever |
SEE ALSO
python(1), update-logfmt(1), logfmt(5)