InfluxDB Line Protocol
Insert
GreptimeDB supports HTTP InfluxDB Line protocol. You can write data via /influxdb/write
API:
shell
curl -i -XPOST "http://localhost:4000/v1/influxdb/write?db=public&precision=ms" \
--data-binary \
'monitor,host=127.0.0.1 cpu=0.1,memory=0.4 1667446797450
monitor,host=127.0.0.2 cpu=0.2,memory=0.3 1667446798450
monitor,host=127.0.0.1 cpu=0.5,memory=0.2 1667446798450'
The /influxdb/write
supports query params including:
db
specify which db to write,public
by default.precision
, precision of timestamps in the line protocol. Acceptsns
(nanoseconds),us
(microseconds),ms
(milliseconds) ands
(seconds), nanoseconds by default.
You can also omit the timestamp when sending requests. GreptimeDB will use the current system time (in UTC) of the host machine as the timestamp. For example:
shell
curl -i -XPOST "http://localhost:4000/v1/influxdb/write?db=public&precision=ms" \
--data-binary \
'monitor,host=127.0.0.1 cpu=0.1,memory=0.4
monitor,host=127.0.0.2 cpu=0.2,memory=0.3
monitor,host=127.0.0.1 cpu=0.5,memory=0.2'
Reference
当前内容版权归 GreptimeDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 GreptimeDB .