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
The **labels** processor lets you manipulate the labels of metrics.
3
2
4
-
Similar to filters, this processor presents a enriching/modifying mechanism to
5
-
perform operations for labels manipulation. The most significant difference is
6
-
that processors perform better than filters, and when chaining them there are no
7
-
encoding or decoding performance penalties.
3
+
The _labels_ processor lets you manipulate the labels of metrics.
4
+
5
+
Similar to filters, this processor presents a enriching/modifying mechanism to perform operations for labels manipulation. The most significant difference is that processors perform better than filters, and when chaining them there are no encoding or decoding performance penalties.
8
6
9
7
{% hint style="info" %}
10
8
11
-
**Note:** Both processors and this specific component can be enabled only by using
12
-
the YAML configuration format. Classic mode configuration format doesn't support
13
-
processors.
9
+
Only [YAML configuration files](../administration/configuring-fluent-bit/yaml/README.md) support processors.
14
10
15
11
{% endhint %}
16
12
17
-
## Configuration Parameters
13
+
## Configuration parameters
18
14
19
-
| Key | Description |
20
-
|:-----|:---------- |
21
-
| update |Update an existing key with a value into metrics. The key/value pair is required. If the specified key doesn't exist, the operation silently fails and has no effect. |
22
-
| insert |Insert a new key with a value into metrics. The key/value pair is required. |
23
-
| upsert| Upsert a specific key with a value, the `upsert` operation will try to update the value of the key. If the key does not exist, the key will be created. The key-value pair is required. |
24
-
| delete |Delete a key from the labels of metrics. The key/value pair is required. If the specified key doesn't exist, the operation silently fails and has no effect. |
25
-
| hash| Replace the key value with a hash generated by the SHA-256 algorithm from the specified label name. The generated binary value is set as a hex string. |
15
+
| Key | Description |
16
+
| --- |----------- |
17
+
|`update`|Updates an existing key with a value into metrics. The key/value pair is required. If the specified key doesn't exist, the operation silently fails and has no effect. |
18
+
|`insert`|Inserts a new key with a value into metrics. The key/value pair is required. |
19
+
|`upsert`| Upserts a specific key with a value, the `upsert` operation will try to update the value of the key. If the specified key doesn't exist, a new key will be created. The key/value pair is required. |
20
+
|`delete`|Deletes a key from the labels of metrics. The key/value pair is required. If the specified key doesn't exist, the operation silently fails and has no effect. |
21
+
|`hash`| Replaces the key value with a hash generated by the SHA-256 algorithm from the specified label name. The generated binary value is set as a hex string. |
26
22
27
-
####Update example
23
+
### Update example
28
24
29
-
Change the value of the `name` to `fluentbit`:
25
+
The following example changes the value of the `name` key to `fluentbit`:
30
26
31
27
{% tabs %}
32
28
{% tab title="fluent-bit.yaml" %}
@@ -35,7 +31,7 @@ Change the value of the `name` to `fluentbit`:
35
31
pipeline:
36
32
inputs:
37
33
- name: fluentbit_metrics
38
-
34
+
39
35
processors:
40
36
metrics:
41
37
- name: labels
@@ -48,10 +44,9 @@ pipeline:
48
44
{% endtab %}
49
45
{% endtabs %}
50
46
51
-
#### Insert example
47
+
### Insert example
52
48
53
-
The following example appends the key `agent` with the value `fluentbit` as the label
54
-
of metrics:
49
+
The following example appends the key `agent` with the value `fluentbit` as the label of metrics:
55
50
56
51
{% tabs %}
57
52
{% tab title="fluent-bit.yaml" %}
@@ -60,12 +55,12 @@ of metrics:
60
55
pipeline:
61
56
inputs:
62
57
- name: fluentbit_metrics
63
-
58
+
64
59
processors:
65
60
metrics:
66
61
- name: labels
67
62
insert: agent fluentbit
68
-
63
+
69
64
outputs:
70
65
- name : stdout
71
66
match: '*'
@@ -74,9 +69,9 @@ pipeline:
74
69
{% endtab %}
75
70
{% endtabs %}
76
71
77
-
#### Upsert example
72
+
### Upsert example
78
73
79
-
Upsert the value of `name` and insert `fluentbit`:
74
+
The following example upserts the value of `name` and inserts `fluentbit`:
80
75
81
76
{% tabs %}
82
77
{% tab title="fluent-bit.yaml" %}
@@ -85,7 +80,7 @@ Upsert the value of `name` and insert `fluentbit`:
85
80
pipeline:
86
81
inputs:
87
82
- name: fluentbit_metrics
88
-
83
+
89
84
processors:
90
85
metrics:
91
86
- name: labels
@@ -98,9 +93,9 @@ pipeline:
98
93
{% endtab %}
99
94
{% endtabs %}
100
95
101
-
#### Delete example
96
+
### Delete example
102
97
103
-
Delete containing `name` key from metrics:
98
+
The following example deletes the `name` key from metrics:
104
99
105
100
{% tabs %}
106
101
{% tab title="fluent-bit.yaml" %}
@@ -109,7 +104,7 @@ Delete containing `name` key from metrics:
109
104
pipeline:
110
105
inputs:
111
106
- name: fluentbit_metrics
112
-
107
+
113
108
processors:
114
109
metrics:
115
110
- name: labels
@@ -122,9 +117,9 @@ pipeline:
122
117
{% endtab %}
123
118
{% endtabs %}
124
119
125
-
#### Hash example
120
+
### Hash example
126
121
127
-
Apply the SHA-1 algorithm for the value of the key `hostname`:
122
+
The following example applies the SHA-1 algorithm for the value of the key `hostname`:
128
123
129
124
{% tabs %}
130
125
{% tab title="fluent-bit.yaml" %}
@@ -133,7 +128,7 @@ Apply the SHA-1 algorithm for the value of the key `hostname`:
0 commit comments