Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 47 additions & 50 deletions concepts/data-pipeline/router.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,41 +36,40 @@ Consider the following configuration example that delivers `CPU` metrics to an E

```yaml
pipeline:
inputs:
- name: cpu
tag: my_cpu
inputs:
- name: cpu
tag: my_cpu

- name: mem
tag: my_mem
- name: mem
tag: my_mem

outputs:
- name: es
match: my_cpu
outputs:
- name: es
match: my_cpu

- name: stdout
match: my_mem
- name: stdout
match: my_mem
```

{% endtab %}

{% tab title="fluent-bit.conf" %}

```text
[INPUT]
Name cpu
Tag my_cpu
Name cpu
Tag my_cpu

[INPUT]
Name mem
Tag my_mem
Name mem
Tag my_mem

[OUTPUT]
Name es
Match my_cpu
Name es
Match my_cpu

[OUTPUT]
Name stdout
Match my_mem
Name stdout
Match my_mem
```

{% endtab %}
Expand All @@ -87,34 +86,33 @@ Routing is flexible enough to support wildcards in the `Match` pattern. The foll

```yaml
pipeline:
inputs:
- name: cpu
tag: my_cpu
inputs:
- name: cpu
tag: my_cpu

- name: mem
tag: my_mem
- name: mem
tag: my_mem

outputs:
- name: stdout
match: 'my_*'
outputs:
- name: stdout
match: 'my_*'
```

{% endtab %}

{% tab title="fluent-bit.conf" %}

```text
[INPUT]
Name cpu
Tag my_cpu
Name cpu
Tag my_cpu

[INPUT]
Name mem
Tag my_mem
Name mem
Tag my_mem

[OUTPUT]
Name stdout
Match my_*
Name stdout
Match my_*
```

{% endtab %}
Expand All @@ -131,37 +129,36 @@ Routing also provides support for regular expressions with the `Match_Regex` pat

```yaml
pipeline:
inputs:
- name: temperature_sensor
tag: temp_sensor_A
inputs:
- name: temperature_sensor
tag: temp_sensor_A

- name: humidity_sensor
tag: humid_sensor_B
- name: humidity_sensor
tag: humid_sensor_B

outputs:
- name: stdout
match: '.*_sensor_[AB]'
outputs:
- name: stdout
match: '.*_sensor_[AB]'
```

{% endtab %}

{% tab title="fluent-bit.conf" %}

```text
[INPUT]
Name temperature_sensor
Tag temp_sensor_A
Name temperature_sensor
Tag temp_sensor_A

[INPUT]
Name humidity_sensor
Tag humid_sensor_B
Name humidity_sensor
Tag humid_sensor_B

[OUTPUT]
Name stdout
Match_regex .*_sensor_[AB]
Name stdout
Match_regex .*_sensor_[AB]
```

{% endtab %}
{% endtabs %}

In this configuration, the `Match_regex` rule is set to `.*_sensor_[AB]`. This regular expression matches any `Tag` that ends with `_sensor_A` or `_sensor_B`, regardless of what precedes it. This approach provides a more flexible and powerful way to handle different source tags with a single routing rule.
In this configuration, the `Match_regex` rule is set to `.*_sensor_[AB]`. This regular expression matches any `Tag` that ends with `_sensor_A` or `_sensor_B`, regardless of what precedes it. This approach provides a more flexible and powerful way to handle different source tags with a single routing rule.