JSONToInflux10

JSONToInflux10 provides a transformation from arbitrary JSON data to InfluxDB 0.9.1+ compatible line protocol data.

Parameters

TimeField (default: time)

Specifies the JSON field that holds the timestamp of the message. The timestamp is formatted as defined by TimeFormat. If the field is not found the current timestamp is assumed. By default this parameter is set to “time”.

TimeFormat (default: unix)

Specifies the format of the time field as in go’s time.Parse or “unix” if the field contains a valid unix timestamp. By default this parameter is set to “unix”.

Measurement (default: measurement)

Specifies the JSON field that holds the measurements in this message. If the field doesn’t exist, the message is discarded. By default this parameter is set to “measurement”.

Ignore

May contain a list of JSON fields that should be ignored and not sent to InfluxDB. By default this parameter is set to an empty list.

Tags

May contain a list of JSON fields to send to InfluxDB as tags. The InfluxDB 0.9 convention is that values that do not change by every request are to be considered metadata and given as tags.

Parameters (from core.SimpleFormatter)

ApplyTo

This value chooses the part of the message the formatting should be applied to. Use “” to target the message payload; other values specify the name of a metadata field to target. By default this parameter is set to “”.

SkipIfEmpty

When set to true, this formatter will not be applied to data that is empty or - in case of metadata - not existing. By default this parameter is set to false

Examples

metricsToInflux:
  Type: producer.InfluxDB
  Streams: metrics
  Host: "influx01:8086"
  Database: "metrics"
  Modulators:
    - format.JSONToInflux10
      TimeField: timestamp
      Measurement: metrics
      Tags:
        - tags
        - service
        - host
        - application