You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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](../key-concepts.md) and [Matching](../key-concepts.md) rules
7
+
Routing is a core feature that lets you route your data through filters and then to
8
+
one or multiple destinations. The router relies on the concept of
9
+
[Tags](../key-concepts.md) and [Matching](../key-concepts.md) rules.
8
10
9
11
```mermaid
10
12
graph LR
@@ -22,16 +24,19 @@ graph LR
22
24
23
25
There are two important concepts in Routing:
24
26
25
-
* Tag
26
-
* Match
27
+
- Tag
28
+
- Match
27
29
28
-
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.
30
+
When data is generated by an input plugins, it comes with a `Tag`. A Tag is a
31
+
human-readable indicator that helps to identify the data source. Tags are usually
32
+
configured manually.
29
33
30
-
In order to define **where** the data should be routed, a **Match** rule must be specified in the output configuration.
34
+
To define where to route data, specify a `Match` rule in the output configuration.
31
35
32
-
Consider the following configuration example that aims to deliver CPU metrics to an Elasticsearch database and Memory metrics to the standard output interface:
36
+
Consider the following configuration example that delivers `CPU` metrics to an
37
+
Elasticsearch database and Memory (`mem`) metrics to the standard output interface:
33
38
34
-
```
39
+
```text
35
40
[INPUT]
36
41
Name cpu
37
42
Tag my_cpu
@@ -49,15 +54,15 @@ Consider the following configuration example that aims to deliver CPU metrics to
49
54
Match my_mem
50
55
```
51
56
52
-
> Note: the above is a simple example demonstrating how Routing is configured.
53
-
54
-
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.
57
+
Routing reads the `Input``Tag` and the `Output``Match` rules. If data has a `Tag`
58
+
that doesn't match at routing time, the data is deleted.
55
59
56
60
## Routing with Wildcard
57
61
58
-
Routing is flexible enough to support _wildcard_ in the **Match** pattern. The below example defines a common destination for both sources of data:
62
+
Routing is flexible enough to support wildcards in the `Match` pattern. The following
63
+
example defines a common destination for both sources of data:
59
64
60
-
```
65
+
```text
61
66
[INPUT]
62
67
Name cpu
63
68
Tag my_cpu
@@ -71,14 +76,15 @@ Routing is flexible enough to support _wildcard_ in the **Match** pattern. The b
71
76
Match my_*
72
77
```
73
78
74
-
The match rule is set to **my\_\*** which means it will match any Tag that starts with **my\_**.
79
+
The match rule is set to `my_*` which matches any Tag starting with `my_*`.
75
80
76
81
## Routing with Regex
77
82
78
-
Routing also provides support for _regex_ with the **Match_Regex** pattern, allowing for more complex and precise matching criteria.
79
-
The following example demonstrates how to route data from sources based on a regular expression:
83
+
Routing also provides support for regular expressions with the `Match_Regex` pattern,
84
+
allowing for more complex and precise matching criteria. The following example
85
+
demonstrates how to route data from sources based on a regular expression:
80
86
81
-
```
87
+
```text
82
88
[INPUT]
83
89
Name temperature_sensor
84
90
Tag temp_sensor_A
@@ -92,5 +98,7 @@ The following example demonstrates how to route data from sources based on a reg
92
98
Match_regex .*_sensor_[AB]
93
99
```
94
100
95
-
In this configuration, the **Match_regex** rule is set to `.*_sensor_[AB]`. This regular expression will match any Tag that ends with "_sensor_A" or "_sensor_B", regardless of what precedes it.
96
-
This approach provides a more flexible and powerful way to handle different source tags with a single routing rule.
101
+
In this configuration, the `Match_regex` rule is set to `.*_sensor_[AB]`. This
102
+
regular expression matches any `Tag` that ends with `_sensor_A` or `_sensor_B`,
103
+
regardless of what precedes it. This approach provides a more flexible and powerful
104
+
way to handle different source tags with a single routing rule.
0 commit comments