1
votes

Successfully installed influxdb on windows and everything is working as expected locally. But having trouble posting data from outside using http api.

I am able to connect to admin panel locally through

http://localhost:8083/

I am using below command for posting data from a remote server:

curl -i -XPOST 'http://172.29.6.195:8086/write?db=telegraf' --data-binary 'test_load,host=njxap1dbadm01 value=13.64'

I am getting below success message:

HTTP/1.1 204 No Content
Request-Id: d3b58c0c-f620-11e5-80a1-000000000000
X-Influxdb-Version: unknown
Date: Wed, 30 Mar 2016 02:40:55 GMT

log on server side:

[http] 2016/03/29 22:40:55 172.29.18.10 - - [29/Mar/2016:22:40:55 -0400] POST /write?db=telegraf HTTP/1.1 204 0 - curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2 d3b58c0c-f620-11e5-80a1-000000000000 0

Even though I got the sucess message on client side some how the data is not getting saved on the database.

I checked for the data from admin panel and returning no data.Checked with curl get also no results.

I have retention policy of 1day for my database. Please help me resolve with the issue of why the data is not getting saved to database.

1

1 Answers

0
votes

I'm trying to reproduce this, but I'm not able to with the latest version on InfluxDB.

~$ curl -i -XPOST 'http://localhost:8086/write?db=telegraf' --data-binary 'test_load,host=njxap1dbadm01 value=13.64'
HTTP/1.1 204 No Content
Request-Id: 38fcfb17-fac3-11e5-8004-000000000000
X-Influxdb-Version: unknown
Date: Tue, 05 Apr 2016 00:13:28 GMT

Logs:

[http] 2016/04/04 17:13:28 ::1 - - [04/Apr/2016:17:13:28 -0700] POST /write?db=telegraf HTTP/1.1 204 0 - curl/7.43.0 38fcfb17-fac3-11e5-8004-000000000000 3.776752ms

Querying:

> use telegraf
Using database telegraf
> show series
key
test_load,host=njxap1dbadm01

> select * from test_load
name: test_load
---------------
time            host        value
1459815208633910164 njxap1dbadm01   13.64

Do you know what version of InfluxDB you are using?