Hello Team, When writing multiple data points to the HTTP write api as mentioned below, I get a 400 (bad time stamp). However when I choose to write a single data point I get 204. Any idea why ?
cpu_1,host=serverA,region=us-west value=1.0 10000000000
cpu_2,host=serverB,region=us-west value=3.3 10000000000
I had the same issue when posting multiple lines from a C# HttpClient using a StringBuilder with AppendLine and the default encoding for StringContent. Switching to using Append with \n as new line and specifying Encoding.ASCII for the StringContent seems to have solved the problem for me.
@lakshmanav - can you please demonstrate this issue using curl commands? Show us that? That would be best.
Hey Guys,
I face the same issue. I even tried the curl command from the terminal.
I copied this from the documentation and ensured it had new lines characters between each point but I get a bad timestamp error.
curl -i -XPOST 'http://localhost:8086/write?db=mydb' -d '
cpu_load_short,host=server01,region=us-west value=0.64
cpu_load_short,host=server02,region=us-west value=0.55 1422568543702900257 cpu_load_short,direction=in,host=server01,region=us-west value=23422.0 1422568543702900257'
HTTP/1.1 400 Bad Request
Request-Id: da13e867-1474-11e5-8067-000000000000
X-Influxdb-Version: FIXME
Date: Tue, 16 Jun 2015 22:13:01 GMT
Content-Length: 13
Content-Type: text/plain; charset=utf-8
bad timestamp%
Similarly, Even if I remove the timestamps associated with each point, I get the same response
curl -i -XPOST 'http://localhost:8086/write?db=mydb' -d '
cpu_load_short,host=server01,region=us-west value=0.64
cpu_load_short,host=server02,region=us-west value=0.55 cpu_load_short,direction=in,host=server01,region=us-west value=23422.0'
HTTP/1.1 400 Bad Request
Request-Id: da13e867-1474-11e5-8067-000000000000
X-Influxdb-Version: FIXME
Date: Tue, 16 Jun 2015 22:13:01 GMT
Content-Length: 13
Content-Type: text/plain; charset=utf-8
bad timestamp%
@juzzjan191 in both of your examples your third point is on the same line as your second, in the position where a timestamp would be expected. It looks like they are on different lines but that's just line wrap. The character in between is not a full \n, but instead a simple space.
Can you verify that your tests are running exactly this:
curl -i -XPOST 'http://localhost:8086/write?db=mydb' -d '
cpu_load_short,host=server01,region=us-west value=0.64
cpu_load_short,host=server02,region=us-west value=0.55 1422568543702900257
cpu_load_short,direction=in,host=server01,region=us-west value=23422.0 1422568543702900257'
I was using \r\n( a windows line ending) to delimit data points. Using \n solved the issue. Thanks @frehm @otoolep and @beckettsean for jumping in.
@beckettsean , Using a space and \n works between points.
curl -i -XPOST 'http://localhost:8086/write?db=mydb' -d 'cpu_load_short,host=server01,region=us-west value=0.64
cpu_load_short,host=server02,region=us-west value=0.55 1422568543702900257
cpu_load_short,direction=in,host=server01,region=us-west value=23422.0 1422568543702900257'
Thanks for your help
Hello Team
I am trying to ingest multiple rows of data to the HTTP using curl as mentioned in the Influxdb documentation, I get a 400(bad time stamp) and parse error. Even after using \n or \r\n (trail and error method) it doesn't work. whereas I am able to ingest single row of data. Any ideas would be highly appreciable.
category_1,host=serverA,region=us-west value=15.6669 10000000000
category_2,host=serverB,region=us-east value=13.6678 10000000000
Another cause for this can be when you are loading from a file using curl. You must use the curl option --data-binary @filename.ilp or else it trims the newline characters.
Most helpful comment
I had the same issue when posting multiple lines from a C#
HttpClientusing aStringBuilderwithAppendLineand the default encoding forStringContent. Switching to usingAppendwith\nas new line and specifyingEncoding.ASCIIfor theStringContentseems to have solved the problem for me.