在命令提示符下一次将多个点插入 Influx DB

Inserting more than one point into Influx DB on a single from command prompt

在 windows 命令提示符下,我试图在一行中输入 2 个点,但我总是遇到解析错误。

如果我尝试用 \r\n 分隔这些点,我会得到相同的解析错误

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

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

有人有做多点插入的经验吗?


更新:使用文件作为 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


INSERT 子句中没有多个点。

您必须使用单独的 INSERTS(顺便问一下,这有什么问题?您为什么坚持将它放在一个子句中?)

或以其他方式使用批量线路协议记录(like this,或通过 REST 端点发送)。