Hi @Anaisdg , thanks for getting back!!
Sorry, I didn’t mean to confuse, let me re-iterate. If I don’t specify the timestamp:
name_override = "interval"
tagexclude = ["url", "host"]
data_format = "json_v2"
[[inputs.http.json_v2]]
[[inputs.http.json_v2.object]]
path = "data"
#timestamp_key = "time"
#timestamp_format = "2023-05-07T19:30:00"
included_keys = [
"value",
"time"
]
telegraf - test returns the following:
interval time="2023-05-07T20:20:00",value=11093.7 1683491942000000000
I meant to say that I don’t need the current time, i.e. the last column in unix / epoch time since that is off from the actual, sensor provided measurement. But when I specify the timeformat:
name_override = "interval"
tagexclude = ["url", "host"]
data_format = "json_v2"
[[inputs.http.json_v2]]
[[inputs.http.json_v2.object]]
path = "data"
timestamp_key = "time"
timestamp_format = "2023-05-07T19:30:00"
included_keys = [
"value",
"time"
]
telegraf - test returns nothing beyond:
(...)
2023-05-07T20:40:15Z W! Outputs are not used in testing mode!
2023-05-07T20:40:15Z I! Tags enabled: host=hostname
I didn’t look into verbose logging, I’m just assuming that the timestamp_format can’t deal with the quotes the datetime is wrapped in (can’t change the sensor json output I’m afraid).
"time": "2023-05-04T23:10:00",
doesn’t work.
"time": 2023-05-04T23:10:00,
should work based on other examples I’ve found (I haven’t fully confirmed with a local json / repro yet).
Just to confirm, you would assume that is the issue too, right? I.e. that timestamp_format can’t match values (iso / epoch) in quotes?
I’ve stumbled over execd but I was also looking at processors.regex, to apply a simple regex to remove the quotes, I just didn’t find how to get a value from the json and then use the processed value as an input for timestamp_format. I’ll look at read some more if you say that is possible.
Sorry for my ignorance and thanks again for your help!
Valentin