Use Telegraf to read JSON file - no error but nothing shown up

Hi, everyone, I encounter an issue when trying to read a JSON file and store the data into Influxdb bucket. The telegraf config file runs well without error reporting but nothing showed up in the influxdb bucket. Could anyone spare some time to have a look please?

My Telegraf config file and JSON file as below:

files = [“C:/Users/xxxx/OneDrive/Bridge/Data/Coding/Sensor/C2DataSample.JSON”]
data_format = “json”
json_query = “$values”
json_time_key = “iotSensorMeasuredDateTime”
json_time_format = “2023-06-20T14:38:41.016”
json_timezone = “UTC”


urls = [“http://localhost:8086”]
token = “rr-vow8rLZBVnPhCBE_d0NzxxKBfykXbKgr84T10-itwgsmWBr5tiAkvc6xtYTdWfIr0nxTNH0eWS_pZXBTWIg==”
organization = “CU”
bucket = “CSV”

JSON file:
“$id”: “1”,
“resultType”: 1,
“innerData”: {
“rawData”: {
“$id”: “2”,
“$values”: [
“$id”: “3”,
“iotSensorMeasuredDateTime”: “2023-06-20T14:38:41.048”,
“accelerometerXMs2”: -0.93,
“accelerometerYMs2”: 0.02,
“accelerometerZMs2”: -0.03
“$id”: “4”,
“iotSensorMeasuredDateTime”: “2023-06-20T14:38:41.016”,
“accelerometerXMs2”: -0.93,
“accelerometerYMs2”: 0.02,
“accelerometerZMs2”: 0.03
“$id”: “5”,
“iotSensorMeasuredDateTime”: “2023-06-20T14:38:41.008”,
“accelerometerXMs2”: -0.93,
“accelerometerYMs2”: 0.03,
“accelerometerZMs2”: -0.02
“$id”: “6”,
“iotSensorMeasuredDateTime”: “2023-06-20T14:38:40.996”,
“accelerometerXMs2”: -0.93,
“accelerometerYMs2”: 0.02,
“accelerometerZMs2”: 0

Powershell running code as below:
2023-09-04T19:01:23Z I! Loading config: C:\Program Files\InfluxData\telegraf\readfile.conf
2023-09-04T19:01:23Z I! Starting Telegraf 1.27.1
2023-09-04T19:01:23Z I! Available plugins: 237 inputs, 9 aggregators, 28 processors, 23 parsers, 59 outputs, 4 secret-stores
2023-09-04T19:01:23Z I! Loaded inputs: file
2023-09-04T19:01:23Z I! Loaded aggregators:
2023-09-04T19:01:23Z I! Loaded processors:
2023-09-04T19:01:23Z I! Loaded secretstores:
2023-09-04T19:01:23Z I! Loaded outputs: influxdb_v2
2023-09-04T19:01:23Z I! Tags enabled: host=LAPTOP-B50QAMN0
2023-09-04T19:01:23Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:“LAPTOP-B50QAMN0”, Flush Interval:10s

@Jamie, how about

  files = [“C:/Users/xxxx/OneDrive/Bridge/Data/Coding/Sensor/C2DataSample.JSON”]
  data_format = "json"
  json_query = "innerData.rawData.$values"
  json_time_key = "iotSensorMeasuredDateTime"
  json_time_format = "2006-01-02T15:04:05.999"
  json_timezone = "UTC"

You need to specify the full path in the GJSON query (the playground might help) and also use the correct time-format!