Log Parser
The Log Parser processor parses log data in a field based on the specified log format. Use the Log Parser to process log data within the pipeline. To read log data directly from an origin system, you can use an origin that processes the log data format, such as File Tail or Kafka Multitopic Consumer.
When you configure Log Parser, you define the field that contains the log line and the field to contain the parsed fields.
You also define the format of the log data to be read, the maximum line length, and the character set of the data. You can configure the processor to retain the original line of the log and to ignore control characters.
If the record contains fields in addition to the field to be parsed, those fields are passed through by default. Parsed fields are written to the specified location, overwriting any existing data.
Log Formats
When you use Log Parser to parse log data, you define the format of the log files to be read.
You can use the following log formats:
- Common Log Format
- A standardized text format used by web servers to generate log files. Also known as the NCSA (National Center for Supercomputing Applications) Common Log format.
- Combined Log Format
- A standardized text format based on the common log format that includes additional information. Also known as the Apache/NCSA Combined Log Format.
- Apache Error Log Format
- The standardized error log format generated by the Apache HTTP Server 2.2.
- Apache Access Log Custom Format
- A customizable access log generated by the Apache HTTP Server 2.2. Use the Apache HTTP Server version 2.2 syntax to define the format of the log file.
- Regular Expression
- Use a regular expression to define the structure of log data, and then assign the field or fields represented by each group.
- Grok Pattern
- Use a grok pattern to define the structure of log data. You can use the grok patterns supported by the Data Collector. You can also define a custom grok pattern and then use it as part of the log format.
- log4j
- A customizable format generated by the Apache Log4j 1.2 logging utility. You can use the default format or specify a custom format. Use the Apache Log4j version 1.2 syntax to define the format of the log file.
Configuring a Log Parser Processor
Configure a Log Parser to parse log data in a field.