InfluxDB

Send data to an InfluxDB

The InfluxDB Output connector can be used to forward data to an InfluxDB. The InfluxDB connector is available in both Data Flow and Rule Engine.

The InfluxDB connector requires

  • the URL or IP address under which the database can be reached

  • the Influx Organization: ID or email

  • the bucket where the data should be stored

  • the Influx API Token with write access to the bucket

  • the Measurement Name is an optional value. If it is not set, the topic of the data sample is used

  • the Mode which is either Event (triggered when a data sample is arriving) or Aggregation (the data is sent every 1 hour with an aggregated value (which?)).

  • The last value that can be set is the custom payload. If no custom payload is set, the data part of the sample will be used. All data keys present in the sample will be saved as fields in InfluxDB.

  • If a subset of the data keys or differently named data keys should be saved, the custom payload templated can be used.

The tags akenzaDeviceId, deviceId and deviceId are automatically created and populated.

Standard Example

Send a data sample to the InfluxDB without Measurement and without payload formatting:

// Translates to line protocol
// general format
<measurement>,[tags] <data key name>=<data key value> <timestamp>
// This example translates to
default,akenzaDeviceId=02b12aa91a7494eb,deviceId=C81758FFFE09845A,deviceName=desksensor occupancy=0 1765286099000

Advanced Example

Save a field named 'desk_occupancy' to InfluxDB. Adapt the custom payload as follows:

// Custom payload
{
 "desk_occupancy": {{data.occupancy}} 
}

Restrictions and Troubleshooting

Measurement names, tags, fields must not begin with underscore (_).

Be aware of duplicates, make sure a point is always structured in the same way, as conflicts or errors can arise if data types or field sets are changing. If the output connector throws an error, check in the InfluxDB console or UI where it comes from. Resolving an error might include deleting some inconsistent data first.

Be aware of changing data types. A field must always use the same types. A common error is a field saved in a different data type once and the output connector will be unable to save this field in a new data type. If the output connector is unable to write, check the affected field for a different data type. This can happen if the payload template can not be resolved completely and an error message is saved as field value.

A tutorial about "How to send data to InfluxDB" can be found here.

InfluxDB template

Last updated

Was this helpful?