Check the InfluxDB v2 API reference for details about API endpoints.
InfluxDB API can be used to retrieve and update data via Data Manipulation Panel.
Thanks to the community member fercasjr for the provided examples.
Update according to your environment:
- IP address or name of the server (
localhostin the example)
- InfluxDB org
- Query is represented by any valid query you already have to test.
To write data to InfluxDB you can use the
wide.to(), or to()` functions in the Flux language or use the API.
The generated payload of the HTTP POST request includes the following:
measurement_name: name of the measurement that is written into InfluxDB (in this example is hardcoded).
tag1: name of the tag that is written into InfluxDB (also hardcoded).
field2: names of fields that are written into InfluxDB (also hardcoded).
body.element_id2: field values that are written into InfluxDB.
Date.now(): code snippet for generating the timestamp of the measurement (is in ms).
The body's elements are coming from the plugin's form, that's why they are placed inside the
body.element_id1is getting the
element_id1value from the