Skip to content
share library_books

Ingest parsed logs and metrics in InfluxDB

Output Plugin: InfluxDB

This plugin converts any message object to influx-line protocol:

  • Numeric fields are converted to InfluxDB fields
  • Text fields are converted to InfluxDB tags
  • Field names in nested objects (e.g. from JSON logs) are flatten using a dot as separator
  • Messages should have a "measurement" field for the InfluxDB measurement name. When the "measurement" field is missing, the measurement name is taken from the "logSource" field.


    - /var/log/sensor-data.log 

    module: output-influxdb
    # InfluxDB URL including optional name and password
    url: http://username:password@
    # InfluxdB datbase name
    db: sensor_data
    # static tags for all metrics
      role: backend
      region: eu
    # flush interval in seconds
    flushInterval: 5
    # max buffer size to force flush
    maxBufferSize: 100
    # Debug option to log influx-line protocol details to stderr
    debug: false
    # A list of message fields, which should be ignored in influxdb output. 
    # Note fields with highly variable content such as log messages could increase InfluxDB memory usage. 
      - message
      - id
    # Only messages matching the filter (RegEx) will be processed
      field: logSource
      match: .*

Start logagent

logagent --config influxdb-output.yaml