Routing is a core feature that allows to route your data through Filters and finally to one or multiple destinations.
There are two important concepts in Routing:
When the data is generated by the input plugins, it comes with a Tag (most of the time the Tag is configured manually), the Tag is a human-readable indicator that helps to identify the data source.
Now to define where the data should be routed, a Match rule is assigned in the configuration.
Consider the following configuration example that aims to deliver CPU metrics to an Elasticsearch database and Memory metrics to the standard output interface:
[INPUT]Name cpuTag my_cpu[INPUT]Name memTag my_mem[OUTPUT]Name esMatch my_cpu[OUTPUT]Name stdoutMatch my_mem
Note: the above example aim to demonstrate in a simplified way how Routing is configured.
Routing works automatically reading the Input Tags and the Output Match rules. If some data have a Tag that don't have a match upon routing time, the data is deleted.
Routing is flexible enough to support wildcard in the Match pattern. The below example defines a common destination for both sources of data:
[INPUT]Name cpuTag my_cpu[INPUT]Name memTag my_mem[OUTPUT]Name stdoutMatch my_*
The match rule is set to my_* which means it will match any Tag that starts with my_.