The parse processing rule
transforms data in a similar way.
Overview
All pipelines include aparsers.conf file with a list of default parsers for
transforming common telemetry formats, including Docker, Apache,
and NGINX logs. You can also create your own parsers
and add them to a pipeline’s parsers file.
Parsers are applied at the source plugin level.
Even though a parsers.conf file can include multiple parsers, you can only
apply a single parser to each source
within a pipeline.
You can also use parsers and processing rules
in tandem. File-based parsers are applied to data first, and then any
processing rules are applied to the resulting parsed data.
Parser syntax
The defaultparsers.conf file included with each pipeline is identical to
the default Fluent Bit parsers.conf file.
Each parser begins with the [PARSER] header and then lists its associated
key/value pairs. For example, this is the default NGINX parser:
Custom parsers
You can add new parsers or modify existing parsers in a pipeline’sparsers.conf file.
Due to Kubernetes ConfigMap
storage limitations, the total size of a pipeline and its associated resources
can’t exceed 1 MiB. This limit includes the combined size of
configuration files, secrets,
parsers, and any other files.
Parser settings
Parsers in Chronosphere Telemetry Pipeline use the same settings as parsers in Fluent Bit. To learn more, consult the Fluent Bit parser configuration parameters documentation.Update parsers file
To add a custom parser to a pipeline, you’ll need to update the parsers file for that pipeline.-
In Pipeline CLI, run the following command to return the contents of your pipeline’s
current parsers file:
Replace
PIPELINEwith the name or unique ID of your pipeline. -
Modify the contents of
parsers.confto include any custom parsers. -
Run the following command to replace the original parsers file with your newly
modified version:
Replace
PIPELINEwith the name or unique ID of your pipeline.
Apply a parser to a source plugin
To apply a parser to a source plugin, add aparser key to the YAML entry for
that plugin in your pipeline’s configuration file.
For example, the following snippet shows a source plugin that uses a parser named
custom_parser:
parser must match the Name value of one of the entries in that
pipeline’s parser.conf file. For example, to use the NGINX parser shown in
this guide’s Syntax example, set parser to nginx.
A source plugin can only use a single parser, but you can apply a parser to
each source plugin within a pipeline. Parsers operate independently between plugins;
any two source plugins within the same pipeline can use different parsers or can
use the same parser.