smartgage.de Docs
curl with Shell Script
write and read data with curl
# https://docs.influxdata.com/influxdb/v1.7/guides/writing_data/
# https://docs.influxdata.com/influxdb/v1.7/write_protocols/line_protocol_reference/
# https://docs.influxdata.com/influxdb/v1.7/write_protocols/line_protocol_tutorial/
curl -i -XPOST "https://smartgage.de:8086/write?db=mydatabase&precision=ms" -u username:password --data-binary @filename
# or
curl -i -XPOST "https://smartgage.de:8086/write?db=mydatabase&precision=ms" -u username:password --data-binary "myproject,tag1=12345678,tag2=Hennigsdorf ch1=1.01,ch2=2.02"
#
# https://docs.influxdata.com/influxdb/v1.7/guides/querying_data/
# https://docs.influxdata.com/influxdb/v1.7/administration/authentication_and_authorization/
curl -G "https://smartgage.de:8086/query" --data-urlencode "u=username" --data-urlencode "p=mypassword" --data-urlencode "db=mydatabase" --data-urlencode "q=SELECT * FROM \"mymeasurement\""
# or
curl -G "https://smartgage.de:8086/query?db=mydatabase&u=username&p=mypassword" --data-urlencode "q=SELECT * FROM \"mymeasurement\""
# or export to csv Table
curl -H "Accept: application/csv" -G "https://smartgage.de:8086/query?db=mydatabase&u=username&p=password" --data-urlencode "q=SELECT * FROM \"mymeasurement\""
# precision may be s (seconds), or ms (milliseconds), or ns (nanoseconds)
# File Format:
# <measurement>[,<tag_key>=<tag_value>[,<tag_key>=<tag_value>]] <field_key>=<field_value>[,<field_key>=<field_value>] [<timestamp>]
# Example File
# MeinInfluxProjekt,SN=12345678,Standort=Hennigsdorf field_key1=1.0000,field_key2=1.0101,field_key3=1.0234 1561306371000
# MeinInfluxProjekt,SN=12345678,Standort=Hennigsdorf field_key1=1.1000,field_key2=1.1101,field_key3=1.0234 1561306372000
#
# Generally: <measurement>,<tagset> <fieldset> <timestamp>
# Comma between measurement and tagset
# Spaces between tagset, fieldset and timestamp
# tagset and fielset are assignments with "="