Skip to content

Commit

Permalink
output: influxdb: document new Auto_Tag and Tag_Keys options (fluent#61)
Browse files Browse the repository at this point in the history
Signed-off-by: Vetési Zoltán <vetesi.zoltan@gmail.com>
  • Loading branch information
zozzz authored and edsiper committed Apr 10, 2018
1 parent d176e2d commit aaee191
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions output/influxdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The __influxdb__ output plugin, allows to flush your records into a [InfluxDB](h
| Sequence_Tag | The name of the tag whose value is incremented for the consecutive simultaneous events. | _seq |
| HTTP\_User | Optional username for HTTP Basic Authentication | |
| HTTP\_Passwd | Password for user defined in HTTP\_User | |
| Tag\_Keys | Space separated list of keys that needs to be tagged | |
| Auto\_Tags | Automatically tag keys where value is *string*. This option takes a boolean value: True/False, On/Off. | Off |

### TLS / SSL

Expand Down Expand Up @@ -53,6 +55,33 @@ In your main configuration file append the following _Input_ & _Output_ sections
Sequence_Tag _seq
```

#### Tagging

Basic example of `Tag_Keys` usage:

```Python
[INPUT]
Name tail
Tag apache.access
parser apache2
path /var/log/apache2/access.log

[OUTPUT]
Name influxdb
Match *
Host 127.0.0.1
Port 8086
Database fluentbit
Sequence_Tag _seq
# make tags from method and path fields
Tag_Keys method path
```

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 ore more field value is not *string* typed.

### Testing

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.
Expand Down Expand Up @@ -129,3 +158,28 @@ The CPU input plugin gather more metrics per CPU core, in the above example we j
```
> SELECT * FROM cpu
```

#### 4. View tags

Query tagged keys:

```
> SHOW TAG KEYS ON fluentbit FROM "apache.access"
name: apache.access
tagKey
------
_seq
method
path
```

And now query *method* key values:

```
> SHOW TAG VALUES ON fluentbit FROM "apache.access" WITH KEY = "method"
name: apache.access
key value
--- -----
method "MATCH"
method "POST"
```

0 comments on commit aaee191

Please sign in to comment.