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 **influxdb** output plugin, allows to flush your records into a [InfluxDB](https://www.influxdata.com/time-series-platform/influxdb/) time series database. The following instructions assumes that you have a fully operational InfluxDB service running in your system.
3
+
The _InfluxDB_ output plugin lets you flush your records into a [InfluxDB](https://www.influxdata.com/time-series-platform/influxdb/) time series database. The following instructions assume that you have an operational InfluxDB service running in your system.
4
4
5
-
## Configuration Parameters
5
+
## Configuration parameters
6
6
7
-
| Key | Description | default |
7
+
This plugin supports the following parameters:
8
+
9
+
| Key | Description | Default |
8
10
| :--- | :--- | :--- |
9
-
| Host | IP address or hostname of the target InfluxDB service | 127.0.0.1 |
10
-
| Port | TCP port of the target InfluxDB service | 8086 |
11
-
| Database | InfluxDB database name where records will be inserted | fluentbit |
12
-
| Bucket | InfluxDB bucket name where records will be inserted - if specified, `database` is ignored and v2 of API is used ||
13
-
| Org | InfluxDB organization name where the bucket is \(v2 only\)| fluent |
14
-
|Sequence\_Tag| The name of the tag whose value is incremented for the consecutive simultaneous events. |\_seq |
15
-
|HTTP\_User| Optional username for HTTP Basic Authentication ||
16
-
|HTTP\_Passwd| Password for user defined in HTTP\_User||
17
-
|HTTP\_Token| Authentication token used with InfluDB v2 - if specified, both HTTP\_User and HTTP\_Passwd are ignored ||
18
-
|HTTP\_Header| Add a HTTP header key/value pair. Multiple headers can be set||
19
-
|Tag\_Keys| Space separated list of keys that needs to be tagged ||
20
-
|Auto\_Tags| Automatically tag keys where value is _string_. This option takes a boolean value: True/False, On/Off. | Off |
21
-
| Uri | Custom URI endpoint||
22
-
|Add\_Integer\_Suffix| Use integer type of [influxdb's line protocol](https://docs.influxdata.com/influxdb/v1/write_protocols/line_protocol_reference/). This option takes a boolean value: `True|False`, `On|Off`. |`Off`|
23
-
| Workers | The number of [workers](../../administration/multithreading.md#outputs) to perform flush operations for this output. |`0`|
11
+
|`Host`| IP address or hostname of the target InfluxDB service.|`127.0.0.1`|
12
+
|`Port`| TCP port of the target InfluxDB service.|`8086`|
13
+
|`Database`| InfluxDB database name where records will be inserted.|`fluentbit`|
14
+
|`Bucket`| InfluxDB bucket name where records will be inserted. If specified, `database` is ignored and v2 of API is used.|_none_|
15
+
|`Org`| InfluxDB organization name where the bucket is (v2 only).|`fluent`|
16
+
|`Sequence_Tag`| The name of the tag whose value is incremented for the consecutive simultaneous events. |`_seq`|
17
+
|`HTTP_User`| Optional username for HTTP Basic Authentication.|_none_|
18
+
|`HTTP_Passwd`| Password for user defined in `HTTP_User`.|_none_|
19
+
|`HTTP_Token`| Authentication token used with InfluxDB v2. If specified, both `HTTP_User` and `HTTP_Passwd` are ignored.|_none_|
20
+
|`HTTP_Header`| Add a HTTP header key/value pair. Multiple headers can be set. |_none_|
21
+
|`Tag_Keys`| Space separated list of keys that needs to be tagged.|_none_|
22
+
|`Auto_Tags`| Automatically tag keys where value is `string`. This option takes a Boolean value: `True`/`False`, `On`/`Off`. |`Off`|
23
+
|`Uri`| Custom URI endpoint. |_none_|
24
+
|`Add_Integer_Suffix`| Use integer type of [InfluxDB's line protocol](https://docs.influxdata.com/influxdb/v1/write_protocols/line_protocol_reference/). This option takes a Boolean value: `True`/`False`, `On`/`Off`. |`Off`|
25
+
|`Workers`| The number of [workers](../../administration/multithreading.md#outputs) to perform flush operations for this output. |`0`|
24
26
25
27
### TLS / SSL
26
28
27
29
The InfluxDB output plugin supports TLS/SSL.
28
30
For more details about the properties available and general configuration, see [TLS/SSL](../../administration/transport-security.md).
29
31
30
-
## Getting Started
32
+
## Get started
31
33
32
-
In order to start inserting records into an InfluxDB service, you can run the plugin from the command line or through the configuration file:
34
+
To start inserting records into an InfluxDB service, you can run the plugin from the command line or through the configuration file.
33
35
34
-
### Command Line
36
+
### Command line
35
37
36
-
The **influxdb** plugin, can read the parameters from the command line in two ways, through the **-p** argument \(property\) or setting them directly through the service URI. The URI format is the following:
38
+
The InfluxDB plugin can read the parameters from the command line through the `-p` argument (property) or by setting them directly through the service URI. The URI format is the following:
37
39
38
40
```text
39
41
influxdb://host:port
40
42
```
41
43
42
-
Using the format specified, you could start Fluent Bit through:
44
+
Using the format specified, you could start Fluent Bit:
43
45
44
46
```shell
45
47
fluent-bit -i cpu -t cpu -o influxdb://127.0.0.1:8086 -m '*'
46
48
```
47
49
48
-
### Configuration File
50
+
### Configuration file
49
51
50
52
In your main configuration file append the following:
51
53
@@ -57,7 +59,7 @@ pipeline:
57
59
inputs:
58
60
- name: cpu
59
61
tag: cpu
60
-
62
+
61
63
outputs:
62
64
- name: influxdb
63
65
match: '*'
@@ -101,7 +103,7 @@ pipeline:
101
103
tag: apache.access
102
104
parser: apache2
103
105
path: /var/log/apache2/access.log
104
-
106
+
105
107
outputs:
106
108
- name: influxdb
107
109
match: '*'
@@ -137,9 +139,9 @@ pipeline:
137
139
{% endtab %}
138
140
{% endtabs %}
139
141
140
-
With **Auto\_Tags=On** in this example cause error, because every parsed field value type is _string_. Best usage of this option in metrics like record where one or more field value is not _string_ typed.
142
+
`Auto_Tags=On` in this example causes an error, because every parsed field value type is `string`. The best usage of this option in metrics like record where one or more field value isn't `string` typed.
141
143
142
-
Basic example of `Tags_List_Key` usage:
144
+
A basic example of `Tags_List_Key` usage:
143
145
144
146
{% tabs %}
145
147
{% tab title="fluent-bit.yaml" %}
@@ -150,7 +152,7 @@ pipeline:
150
152
- name: dummy
151
153
# tagged fields: level, ID, businessObjectID, status
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.
197
+
Before starting Fluent Bit, ensure the target database exists on InfluxDB. Using the previous example, insert the data into a `fluentbit` database.
196
198
197
-
#### 1. Create database
199
+
1.Log into the InfluxDB console:
198
200
199
-
Log into InfluxDB console:
201
+
```shell
202
+
influx
203
+
```
200
204
201
-
```shell
202
-
$ influx
205
+
Which should return a result like:
203
206
204
-
Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring.
205
-
Connected to http://localhost:8086 version 1.1.0
206
-
InfluxDB shell version: 1.1.0
207
-
>
208
-
```
207
+
```text
208
+
Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring.
209
+
Connected to http://localhost:8086 version 1.1.0
210
+
InfluxDB shell version: 1.1.0
211
+
>
212
+
```
209
213
210
-
Create the database:
214
+
1.Create the database:
211
215
212
-
```text
213
-
> create database fluentbit
214
-
>
215
-
```
216
+
```text
217
+
> create database fluentbit
218
+
>
219
+
```
216
220
217
-
Check the database exists:
221
+
1.Check that the database exists:
218
222
219
-
```text
220
-
> show databases
221
-
name: databases
222
-
name
223
-
----
224
-
_internal
225
-
fluentbit
226
-
227
-
>
228
-
```
223
+
```text
224
+
> show databases
225
+
name: databases
226
+
name
227
+
----
228
+
_internal
229
+
fluentbit
229
230
230
-
#### 2. Run Fluent Bit
231
+
>
232
+
```
231
233
232
-
The following command will gather CPU metrics from the system and send the data to InfluxDB database every five seconds:
234
+
1. Run Fluent Bit:
233
235
234
-
```shell
235
-
fluent-bit -i cpu -t cpu -o influxdb -m '*'
236
-
```
236
+
The following command will gather CPU metrics from the system and send the data to InfluxDB database every five seconds:
237
237
238
-
Note that all records coming from the _cpu_ input plugin, have a tag _cpu_, this tag is used to generate the measurement in InfluxDB
238
+
```shell
239
+
fluent-bit -i cpu -t cpu -o influxdb -m '*'
240
+
```
239
241
240
-
#### 3. Query the data
242
+
All records coming from the `cpu` input plugin have a tag `cpu`. This tag is used to generate the measurement in InfluxDB.
241
243
242
-
From InfluxDB console, choose your database:
244
+
1. Query the data:
243
245
244
-
```text
245
-
> use fluentbit
246
-
Using database fluentbit
247
-
```
246
+
From InfluxDB console, choose your database:
248
247
249
-
Now query some specific fields:
248
+
```text
249
+
> use fluentbit
250
+
Using database fluentbit
251
+
```
250
252
251
-
```text
252
-
> SELECT cpu_p, system_p, user_p FROM cpu
253
-
name: cpu
254
-
time cpu_p system_p user_p
255
-
---- ----- -------- ------
256
-
1481132860000000000 2.75 0.5 2.25
257
-
1481132861000000000 2 0.5 1.5
258
-
1481132862000000000 4.75 1.5 3.25
259
-
1481132863000000000 6.75 1.25 5.5
260
-
1481132864000000000 11.25 3.75 7.5
261
-
```
253
+
1. Query some specific fields:
262
254
263
-
The CPU input plugin gather more metrics per CPU core, in the above example we just selected three specific metrics. The following query will give a full result:
255
+
```text
256
+
> SELECT cpu_p, system_p, user_p FROM cpu
257
+
name: cpu
258
+
time cpu_p system_p user_p
259
+
---- ----- -------- ------
260
+
1481132860000000000 2.75 0.5 2.25
261
+
1481132861000000000 2 0.5 1.5
262
+
1481132862000000000 4.75 1.5 3.25
263
+
1481132863000000000 6.75 1.25 5.5
264
+
1481132864000000000 11.25 3.75 7.5
265
+
```
264
266
265
-
```text
266
-
> SELECT * FROM cpu
267
-
```
267
+
The CPU input plugin gathers more metrics per CPU core. This example selected three specific metrics. The following query will give a full result:
268
268
269
-
#### 4. View tags
269
+
```text
270
+
> SELECT * FROM cpu
271
+
```
270
272
271
-
Query tagged keys:
273
+
1. View tags by querying tagged keys:
272
274
273
-
```text
274
-
> SHOW TAG KEYS ON fluentbit FROM "apache.access"
275
-
name: apache.access
276
-
tagKey
277
-
------
278
-
_seq
279
-
method
280
-
path
281
-
```
275
+
```text
276
+
> SHOW TAG KEYS ON fluentbit FROM "apache.access"
277
+
name: apache.access
278
+
tagKey
279
+
------
280
+
_seq
281
+
method
282
+
path
283
+
```
282
284
283
-
And now query _method_ key values:
285
+
1. Query `method` key values:
284
286
285
-
```text
286
-
> SHOW TAG VALUES ON fluentbit FROM "apache.access" WITH KEY = "method"
287
-
name: apache.access
288
-
key value
289
-
--- -----
290
-
method "MATCH"
291
-
method "POST"
292
-
```
287
+
```text
288
+
> SHOW TAG VALUES ON fluentbit FROM "apache.access" WITH KEY = "method"
0 commit comments