Router
Create flexible routing rules
Routing is a core feature that allows to route your data through Filters and finally to one or multiple destinations. The router relies on the concept of Tags and Matching rules
There are two important concepts in Routing:
  • Tag
  • Match
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.
In order to define where the data should be routed, a Match rule must be specified in the output configuration.
Consider the following configuration example that aims to deliver CPU metrics to an Elasticsearch database and Memory metrics to the standard output interface:
1
[INPUT]
2
Name cpu
3
Tag my_cpu
4
5
[INPUT]
6
Name mem
7
Tag my_mem
8
9
[OUTPUT]
10
Name es
11
Match my_cpu
12
13
[OUTPUT]
14
Name stdout
15
Match my_mem
Copied!
Note: the above is a simple example demonstrating how Routing is configured.
Routing works automatically reading the Input Tags and the Output Match rules. If some data has a Tag that doesn't match upon routing time, the data is deleted.

Routing with Wildcard

Routing is flexible enough to support wildcard in the Match pattern. The below example defines a common destination for both sources of data:
1
[INPUT]
2
Name cpu
3
Tag my_cpu
4
5
[INPUT]
6
Name mem
7
Tag my_mem
8
9
[OUTPUT]
10
Name stdout
11
Match my_*
Copied!
The match rule is set to my_* which means it will match any Tag that starts with my_.
Last modified 5mo ago
Export as PDF
Copy link