When I saw the influxDB with HTTP API reference(https://docs.influxdata.com/influxdb/v1.7/tools/api/), I could see the examples that only one field is inserted to influxDB. I wanted to insert one more fields with HTTP API.
For examples, suppose you create a database named 'mydb' and you want to insert one tag named 'host' and two fields ('a', 'b') in table named 'test'. In this case, you can do it by running the below command on console.
curl -i -XPOST 'http://localhost:8086/write?db=mydb' -u your_id:your_passwd --data-binary 'test,host=your_host a=some_value,b=some_value epoch_time'
If you want to control the time in influxDB, you can set it by typing a space and epoch time at the end.
During I tried to use influxDB with HTTP API, I faced an error that is '{"error":"unable to parse authentication credentials"}. I solved it by adding option in command that is '-u your_id:your_passwd'. But, If you don't face like this error, you don't need to type '-u your_id:your_passwd'. Refer to https://docs.influxdata.com/influxdb/v1.7/tools/api/
'STUDY' 카테고리의 다른 글
[Docker] 도커로 influxDB+Grafana 설치하기 (0) | 2019.04.09 |
---|---|
우분투에서 php 파일 실행이 안된다! (3) | 2018.11.29 |
[ATOM] 아톰 SSH 연결하기 (0) | 2018.01.05 |
라즈베리파이, 집에 놓고 다닐래!(외부 ip에서 내부 ip 접속하기) (0) | 2017.08.30 |
[LinkedList] C로 짜는 LinkedLIst (algospot HELLOWORLD) (0) | 2017.05.12 |