Skip to content

Commit 16b5de9

Browse files
authored
Merge pull request #1489 from fluent/lynettemiles/sc-105701/update-concepts-data-pipeline-router-md-fluent
2 parents 6909ed4 + edaac73 commit 16b5de9

File tree

1 file changed

+26
-18
lines changed

1 file changed

+26
-18
lines changed

concepts/data-pipeline/router.md

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ description: Create flexible routing rules
44

55
# Router
66

7-
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.
810

911
```mermaid
1012
graph LR
@@ -22,16 +24,19 @@ graph LR
2224

2325
There are two important concepts in Routing:
2426

25-
* Tag
26-
* Match
27+
- Tag
28+
- Match
2729

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 plugin, 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.
2933

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.
3135

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:
3338

34-
```
39+
```text
3540
[INPUT]
3641
Name cpu
3742
Tag my_cpu
@@ -49,15 +54,15 @@ Consider the following configuration example that aims to deliver CPU metrics to
4954
Match my_mem
5055
```
5156

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.
5559

5660
## Routing with Wildcard
5761

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:
5964

60-
```
65+
```text
6166
[INPUT]
6267
Name cpu
6368
Tag my_cpu
@@ -71,14 +76,15 @@ Routing is flexible enough to support _wildcard_ in the **Match** pattern. The b
7176
Match my_*
7277
```
7378

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_*`.
7580

7681
## Routing with Regex
7782

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:
8086

81-
```
87+
```text
8288
[INPUT]
8389
Name temperature_sensor
8490
Tag temp_sensor_A
@@ -92,5 +98,7 @@ The following example demonstrates how to route data from sources based on a reg
9298
Match_regex .*_sensor_[AB]
9399
```
94100

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

Comments
 (0)