(Created page with "InfluxDB is a time series database written in Go. == Writing Data == The schema of a InfluxDB database is based on the very first initial data types added. Adding additional...")
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
 
* https://docs.influxdata.com/influxdb/v1.7/guides/writing_data/
 
* https://docs.influxdata.com/influxdb/v1.7/guides/writing_data/
 
* https://www.influxdata.com/blog/how-to-send-sensor-data-to-influxdb-from-an-arduino-uno/
 
* https://www.influxdata.com/blog/how-to-send-sensor-data-to-influxdb-from-an-arduino-uno/
 +
 +
=== Curl ===
 +
Using {{code|curl}}, you can POST values to a particular database using the line protocol. For more information, see https://docs.influxdata.com/influxdb/v0.9/write_protocols/line/
 +
{{highlight|lang=terminal|code=
 +
$ curl -X POST 'http://influxdb/write?db=lsf' --data-binary 'measurement,tag1=x,tag2=x recorded_value1=x `date +%s"000000000"`'
 +
}}
 +
 +
For multiple entries, write multiple lines separated by a {{code|\n}} newline and POST with Curl like above.
 +
{{highlight|lang=terminal|code=
 +
$ cat /tmp/measurements {{!}} curl -X POST 'http://influxdb/write?db=lsf' --data-binary @-'
 +
}}

Revision as of 11:23, 10 February 2020

InfluxDB is a time series database written in Go.

Writing Data

The schema of a InfluxDB database is based on the very first initial data types added. Adding additional data with a different type will be rejected.

Curl

Using curl, you can POST values to a particular database using the line protocol. For more information, see https://docs.influxdata.com/influxdb/v0.9/write_protocols/line/

$ curl -X POST 'http://influxdb/write?db=lsf' --data-binary 'measurement,tag1=x,tag2=x recorded_value1=x `date +%s"000000000"`'

For multiple entries, write multiple lines separated by a \n newline and POST with Curl like above.

$ cat /tmp/measurements | curl -X POST 'http://influxdb/write?db=lsf' --data-binary @-'