@@ -36,6 +36,30 @@ To define where to route data, specify a `Match` rule in the output configuratio
36
36
Consider the following configuration example that delivers ` CPU ` metrics to an
37
37
Elasticsearch database and Memory (` mem ` ) metrics to the standard output interface:
38
38
39
+ {% tabs %}
40
+ {% tab title="fluent-bit.yaml" %}
41
+
42
+ ``` yaml
43
+ pipeline :
44
+ inputs :
45
+ - name : cpu
46
+ tag : my_cpu
47
+
48
+ - name : mem
49
+ tag : my_mem
50
+
51
+ outputs :
52
+ - name : es
53
+ match : my_cpu
54
+
55
+ - name : stdout
56
+ match : my_mem
57
+ ` ` `
58
+
59
+ {% endtab %}
60
+
61
+ {% tab title="fluent-bit.conf" %}
62
+
39
63
` ` ` text
40
64
[INPUT]
41
65
Name cpu
@@ -54,6 +78,9 @@ Elasticsearch database and Memory (`mem`) metrics to the standard output interfa
54
78
Match my_mem
55
79
```
56
80
81
+ {% endtab %}
82
+ {% endtabs %}
83
+
57
84
Routing reads the ` Input ` ` Tag ` and the ` Output ` ` Match ` rules. If data has a ` Tag `
58
85
that doesn't match at routing time, the data is deleted.
59
86
@@ -62,6 +89,27 @@ that doesn't match at routing time, the data is deleted.
62
89
Routing is flexible enough to support wildcards in the ` Match ` pattern. The following
63
90
example defines a common destination for both sources of data:
64
91
92
+ {% tabs %}
93
+ {% tab title="fluent-bit.yaml" %}
94
+
95
+ ``` yaml
96
+ pipeline :
97
+ inputs :
98
+ - name : cpu
99
+ tag : my_cpu
100
+
101
+ - name : mem
102
+ tag : my_mem
103
+
104
+ outputs :
105
+ - name : stdout
106
+ match : ' my_*'
107
+ ` ` `
108
+
109
+ {% endtab %}
110
+
111
+ {% tab title="fluent-bit.conf" %}
112
+
65
113
` ` ` text
66
114
[INPUT]
67
115
Name cpu
@@ -76,6 +124,9 @@ example defines a common destination for both sources of data:
76
124
Match my_*
77
125
```
78
126
127
+ {% endtab %}
128
+ {% endtabs %}
129
+
79
130
The match rule is set to ` my_* ` , which matches any Tag starting with ` my_ ` .
80
131
81
132
## Routing with Regex
@@ -84,6 +135,27 @@ Routing also provides support for regular expressions with the `Match_Regex` pat
84
135
allowing for more complex and precise matching criteria. The following example
85
136
demonstrates how to route data from sources based on a regular expression:
86
137
138
+ {% tabs %}
139
+ {% tab title="fluent-bit.yaml" %}
140
+
141
+ ``` yaml
142
+ pipeline :
143
+ inputs :
144
+ - name : temperature_sensor
145
+ tag : temp_sensor_A
146
+
147
+ - name : humidity_sensor
148
+ tag : humid_sensor_B
149
+
150
+ outputs :
151
+ - name : stdout
152
+ match : ' .*_sensor_[AB]'
153
+ ` ` `
154
+
155
+ {% endtab %}
156
+
157
+ {% tab title="fluent-bit.conf" %}
158
+
87
159
` ` ` text
88
160
[INPUT]
89
161
Name temperature_sensor
@@ -98,7 +170,10 @@ demonstrates how to route data from sources based on a regular expression:
98
170
Match_regex .*_sensor_[AB]
99
171
```
100
172
173
+ {% endtab %}
174
+ {% endtabs %}
175
+
101
176
In this configuration, the ` Match_regex ` rule is set to ` .*_sensor_[AB] ` . This
102
177
regular expression matches any ` Tag ` that ends with ` _sensor_A ` or ` _sensor_B ` ,
103
178
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.
179
+ way to handle different source tags with a single routing rule.
0 commit comments