InfluxDB Line Protocol Input Format
To use this Apache Druid extension, include druid-influx-extensions in the extensions load list.
This extension enables Druid to parse the InfluxDB Line Protocol, a popular text-based timeseries metric serialization format.
Line Protocol
A typical line looks like this:
cpu,application=dbhost=prdb123,region=us-east-1 usage_idle=99.24,usage_user=0.55 1520722030000000000
which contains four parts:
- measurement: A string indicating the name of the measurement represented (e.g. cpu, network, web_requests)
- tags: zero or more key-value pairs (i.e. dimensions)
- measurements: one or more key-value pairs; values can be numeric, boolean, or string
- timestamp: nanoseconds since Unix epoch (the reader truncates it to milliseconds)
The input format extracts these fields into a map, giving the measurement the key measurement and the timestamp the key __ts. The tag and measurement keys are copied verbatim, so users should take care to avoid name collisions. It is up to the ingestion spec to decide which fields should be treated as dimensions and which should be treated as metrics (typically tags correspond to dimensions and measurements correspond to metrics).
The input format is configured like so:
"inputFormat": {
"type": "influx",
"whitelistMeasurements": [
"cpu"
]
}
| Field | Type | Description | Required |
|---|---|---|---|
type | String | Must be influx. | yes |
whitelistMeasurements | List of String | If present, measurements that do not match one of the strings in the list will be ignored. | no |
When using the influx input format, the timestamp spec should be configured with column __ts and format millis:
"timestampSpec": {
"column": "__ts",
"format": "millis"
}