Skip to content

Commit cd45857

Browse files
author
Ueli Graf
committed
out_influxdb: add documentation and example use of strip_prefix
Signed-off-by: Ueli Graf <[email protected]>
1 parent 06418e9 commit cd45857

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

pipeline/outputs/influxdb.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The **influxdb** output plugin, allows to flush your records into a [InfluxDB](h
1212
| Bucket | InfluxDB bucket name where records will be inserted - if specified, `database` is ignored and v2 of API is used | |
1313
| Org | InfluxDB organization name where the bucket is \(v2 only\) | fluent |
1414
| Sequence\_Tag | The name of the tag whose value is incremented for the consecutive simultaneous events. | \_seq |
15+
| Strip\_Prefix | String to be stripped from the front of _tag_ when writing influxdb measurement names | |
1516
| HTTP\_User | Optional username for HTTP Basic Authentication | |
1617
| HTTP\_Passwd | Password for user defined in HTTP\_User | |
1718
| HTTP\_Token | Authentication token used with InfluDB v2 - if specified, both HTTP\_User and HTTP\_Passwd are ignored | |
@@ -109,6 +110,40 @@ Basic example of `Tags_List_Key` usage:
109110
Tag_Keys level status
110111
```
111112

113+
### Prefix stripping
114+
115+
When collecting data from many inputs into many buckets, it can be helpful to remove a common prefix using _Strip_prefix_.
116+
117+
```python
118+
[INPUT]
119+
Name cpu
120+
Tag cpu.one
121+
122+
[INPUT]
123+
Name cpu
124+
Tag cpu.two
125+
126+
[INPUT]
127+
Name cpu
128+
Tag gpu.one
129+
130+
[INPUT]
131+
Name cpu
132+
Tag gpu.two
133+
134+
[OUTPUT]
135+
Name influxdb
136+
Match cpu*
137+
Bucket cpubucket
138+
Strip_prefix cpu.
139+
140+
[OUTPUT]
141+
Name influxdb
142+
Match gpu*
143+
Bucket gpubucket
144+
Strip_prefix gpu.
145+
```
146+
112147
### Testing
113148

114149
Before to start Fluent Bit, make sure the target database exists on InfluxDB, using the above example, we will insert the data into a _fluentbit_ database.

0 commit comments

Comments
 (0)