2

From a windows command prompt i'm attempting to enter 2 points on a single line, but I always get a parsing error.

If I try to separate the points with a \r\n, I get the same parse error

INSERT temperature,location=cityname value=-6.01 1575378000temperature,location=cityname value=-5.99 1575381600

ERR: {"error":"unable to parse 'temperature,location=cityname value=-6.01 1575378000temperature,location=cityname value=-5.99 1575381600': bad timestamp"}

Anyone have any experience with doing multi point inserts?


Update: using a file as input with curl

.$ curl -i -XPOST 'http://myserver:8086/write?db=testing' --data-binary @example.txt
HTTP/1.1 400 Bad Request
Content-Type: application/json
Request-Id: f005e1c8-1613-11ea-82ff-00155d0968c8
X-Influxdb-Build: OSS
X-Influxdb-Error: unable to parse 'temperature,location=cityname value=-6.00 1575378000 ': bad timestamp unable to parse 'temperature,location=cityname value=-5.00 1575381600 ': bad timestamp
X-Influxdb-Version: 1.7.7
X-Request-Id: f005e1c8-1613-11ea-82ff-00155d0968c8
Date: Tue, 03 Dec 2019 21:29:07 GMT
Content-Length: 189

{"error":"unable to parse 'temperature,location=cityname value=-6.00 1575378000\r': bad timestamp\nunable to parse 'temperature,location=cityname value=-5.00 1575381600\r': bad timestamp"}

example.txt file contents:
temperature,location=cityname value=-6.00 1575378000
temperature,location=cityname value=-5.00 1575381600


1 Answer 1

1

There's no multiple points in the INSERT clause.

You have to either use separate INSERTS (what's the issue with that, by the way? why would you insist to have it it in a single clause?)

Or use batches of line protocol records another way (like this, or send it through REST endpoint).

Sign up to request clarification or add additional context in comments.

5 Comments

thanks. i will take your suggestion of doing through REST.
how to do i setup the file? currently if i enter more than a single line i get parsing errors.
Sorry, what do you mean by "the file" here? How exactly you intend to use it? And please show how that "file" looks like.
"Line protocol accepts the newline character \n and is whitespace-sensitive" - cite from the l.p. syntax doc. Get rid of '\r'-s & excess whitespaces, should be fine then.
So i'm using c++ to create the example.txt file, and the loop terminates each line with: '\n'. When i open the example.txt file in notepad++ the lines end in CRLF. I think that's parsing of the file fails.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.