https://github.com/influxdata/influxdb-plugin-fluent
A buffered output plugin for Fluentd and InfluxDB 2
https://github.com/influxdata/influxdb-plugin-fluent
fluentd influxdata influxdb ruby timeseries
Last synced: 8 months ago
JSON representation
A buffered output plugin for Fluentd and InfluxDB 2
- Host: GitHub
- URL: https://github.com/influxdata/influxdb-plugin-fluent
- Owner: influxdata
- License: mit
- Created: 2019-12-12T10:29:44.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-05T15:02:52.000Z (almost 2 years ago)
- Last Synced: 2025-03-10T20:04:49.720Z (10 months ago)
- Topics: fluentd, influxdata, influxdb, ruby, timeseries
- Language: Ruby
- Size: 608 KB
- Stars: 21
- Watchers: 7
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# influxdb-plugin-fluent
[](https://circleci.com/gh/influxdata/influxdb-plugin-fluent)
[](https://codecov.io/gh/influxdata/influxdb-plugin-fluent)
[](https://badge.fury.io/rb/fluent-plugin-influxdb-v2)
[](https://github.com/influxdata/influxdb-plugin-fluent/blob/master/LICENSE)
[](https://github.com/influxdata/influxdb-plugin-fluent/issues)
[](https://github.com/influxdata/influxdb-plugin-fluent/pulls)
[](https://www.influxdata.com/slack)
This repository contains the reference Fluentd plugin for the InfluxDB 2.0.
#### Note: This plugin is for use with InfluxDB 2.x. For InfluxDB 1.x instances, please use the [fluent-plugin-influxdb](https://github.com/fangli/fluent-plugin-influxdb) plugin.
## Installation
### Gems
The plugin is bundled as a gem and is hosted on [Rubygems](https://rubygems.org/gems/fluent-plugin-influxdb-v2). You can install the gem as follows:
```
fluent-gem install fluent-plugin-influxdb-v2 -v 1.10.0
```
## Plugins
### influxdb2
Store Fluentd event to InfluxDB 2 database.
#### Configuration
| Option | Description | Type | Default |
|---|---|---|---|
| url | InfluxDB URL to connect to (ex. https://localhost:8086). | String | https://localhost:8086 |
| token | Access Token used for authenticating/authorizing the InfluxDB request sent by client. | String | |
| use_ssl | Turn on/off SSL for HTTP communication. | bool | true |
| verify_mode | Sets the flags for the certification verification at beginning of SSL/TLS session. | `"#{OpenSSL::SSL::VERIFY_NONE}"` or `"#{OpenSSL::SSL::VERIFY_PEER}"` | none |
| bucket | Specifies the destination bucket for writes. | String | |
| org | Specifies the destination organization for writes. | String | |
| measurement | The name of the measurement. If not specified, Fluentd's tag is used. | String | nil |
| tag_keys | The list of record keys that are stored in InfluxDB as 'tag'. | Array | [] |
| tag_fluentd | Specifies if the Fluentd's event tag is included into InfluxDB tags (ex. 'fluentd=system.logs'). | bool | false |
| field_keys | The list of record keys that are stored in InfluxDB as 'field'. If it's not specified than as fields are used all record keys. | Array | [] |
| field_cast_to_float | Turn on/off auto casting Integer value to Float. Helper to avoid mismatch error: 'series type mismatch: already Integer but got Float'. | bool | false |
| time_precision | The time precision of timestamp. You should specify either second (s), millisecond (ms), microsecond (us), or nanosecond (ns). | String | ns |
| time_key | A name of the record key that used as a 'timestamp' instead of event timestamp. If a record key doesn't exists or hasn't value then is used event timestamp. | String | nil |
| line_protocol_key | A name of the record key that contains [LineProtocol](https://docs.influxdata.com/influxdb/v2.0/reference/syntax/line-protocol/). The value of this key is used for ingesting data into InfluxDB. If a record key doesn't exists or hasn't value then is used event timestamp. | String | nil |
##### Minimal configuration
```
@type influxdb2
# InfluxDB URL to connect to (ex. https://localhost:8086).
url https://localhost:8086
# Access Token used for authenticating/authorizing the InfluxDB request sent by client.
token my-token
# Specifies the destination bucket for writes.
bucket my-bucket
# Specifies the destination organization for writes.
org my-org
```
##### Full configuration
```
@type influxdb2
# InfluxDB URL to connect to (ex. https://localhost:8086).
url https://localhost:8086
# Access Token used for authenticating/authorizing the InfluxDB request sent by client.
token my-token
# Turn on/off SSL for HTTP communication.
use_ssl true
# Sets the flags for the certification verification at beginning of SSL/TLS session.
# For more info see - https://docs.ruby-lang.org/en/3.0.0/Net/HTTP.html#verify_mode.
verify_mode "#{OpenSSL::SSL::VERIFY_NONE}"
# Specifies the destination bucket for writes.
bucket my-bucket
# Specifies the destination organization for writes.
org my-org
# The name of the measurement. If not specified, Fluentd's tag is used.
measurement h2o
# The list of record keys that are stored in InfluxDB as 'tag'.
tag_keys ["location", "type"]
# Specifies if the Fluentd's event tag is included into InfluxDB tags (ex. 'fluentd=system.logs).'
tag_fluentd true
# The list of record keys that are stored in InfluxDB as 'field'.
# If it's not specified than as fields are used all record keys.
field_keys ["value"]
# Turn on/off auto casting Integer value to Float.
# Helper to avoid mismatch error: 'series type mismatch: already Integer but got Float'.
field_cast_to_float true
# The time precision of timestamp. You should specify either second (s), millisecond (ms),
# microsecond (us), or nanosecond (ns).
time_precision s
# A name of the record key that used as a 'timestamp' instead of event timestamp.
# If a record key doesn't exists or hasn't value then is used event timestamp.
time_key time
```
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/influxdata/influxdb-plugin-fluent.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).