-
Notifications
You must be signed in to change notification settings - Fork 0
log_parser
Axel Schwab edited this page Mar 11, 2024
·
2 revisions
Log parsers are specified in the Pipeline-Definiton. Multiple parsers can be configured at once. The type specifies the parser kind and parameters.
The formatter provides the following variables
| Variable | Description |
|---|---|
$TIMESTAMP |
The UNIX timestamp (milliseconds) of the log entry |
$SOURCE |
The source of the log (e.g. STANDARD_IO, MANAGEMENT_EVENT) |
$ERROR |
Whether the message originates from an error stream (e.g. 1 for stderr) |
$0 |
The whole matcher |
$1/$2/$3..$n
|
The matcher group |
In addition, all environment variables of the executed stage can also be specified.
...
logParsers:
- matcher: "([\\d]+) %"
destination: "blubb.csv"
formatter: "$TIMESTAMP;$1;$0;$SOURCE;$ERROR;!;$WINSLOW_PIPELINE_ID"
type: "regex-matcher/csv"Hinweis: Backslashes müssen escaped werden: \\, oder single-Quotes verwendet werden - dann werden sie beim nächsten Laden automatisch escaped.
...
logParsers:
- matcher: "([\\d]+) %\n([\\d]+) %\n([\\d]+) %\n([\\d]+) %"
destination: "blubb_$bernd.csv"
formatter: "$TIMESTAMP;$1;$2;$3;$4;$SOURCE;$ERROR;!;$WINSLOW_PIPELINE_ID"
type: "regex-matcher/csv:lines=4"