Inputs.http - only last value of json table is being written to influx

Hey there!

I am having a little problem with writing my data from the http plugin. Let me explain it with that simple example:

My response is JSON that is formatted somewhat like that:

“success”: true,
“data”: [
“text”: “sample”
“number”: 123
“text”: “sample2”
“number”: 456

then my inputs.http config is:

  urls = [
  method = "GET"
  timeout = "5s"
  data_format = "json"
  json_string_fields = ["text"]
  json_query = "data"

My problem is that it seems like that json_query property is causing data to be collected with the same timestamp. So even though -test run is showing all the desired results, only last one is being saved to influx.

Test output (notice the same last value (time)):

> http,host=somehost,text=“sample”,url=sample.url number=123 1537306096000000000
> http,host=somehost,text=“sample2”,url=sample.url number=456 1537306096000000000

Actual influxdb data (as previewed with influxDB shell):

somehost 456 sample2 sample.url 1537306096000000000

Desired result is to see both measuers, so in this case both sample and sample2 but I don’t know how to differ that timestamp, so it’s not overridden.

Thanks for the help in advance!