0

I have followed multiple documentation but I couldn't receive all the metrics from my JSON file to Influxdb.

My Input json file

{
    "apBuildNumber": "04.04.01.0003.1f7fd3ce8896",
    "version": "1.0.0",
    "sentTimeMs": "1661678671000",
    "sciSystemId": "scis1",
    "apMac": "54:ec:2f:18:78:4d",
    "apSerial": "281915001731",
    "apVenue": "test",
    "apName": "281915001731",
    "apTenantId": "tenant",
    "apReport": {},
    "apNonCumulativeReport": {},
    "apCumulativeReport": {
        "cumulativeReportBins": [
            {
                "binStartTime": 123131232,
                "binSampleDurationSec": "10",
                "apCumulativeBinNetworksViews": [
                    {
                        "pci": [
                            123,
                            333
                        ]
                    }
                ]
            },
            {
                "binStartTime": 567567577,
                "binSampleDurationSec": "10",
                "apCumulativeBinNetworksViews": [
                    {
                        "pci": [
                            252,
                            124
                        ]
                    }
                ]
            }
        ]
    },
    "apAlarmsReport": {}
}

what I have tried : My telegraf.conf is like this

data_format = "json_v2"
   [[inputs.file.json_v2]]
       [[inputs.file.json_v2.object]]
           path = "apCumulativeReport"
           disable_prepend_keys = true
           tags = ["cumulativeReportBins_binStartTime"]
           [[inputs.file.json_v2.object.field]]
                path = "cumulativeReportBins_apCumulativeBinNetworksViews_pci"
                type = "int"

Ideally I have to receive all the PCI values from the array but I can see only second element in each PCI array in InfluxDB. Can someone identify what mistake I'm doing here.

enter image description here

Prajyod Kumar
  • 395
  • 2
  • 4
  • 15
  • 1
    You can better see what telegraf will send to Influx by using the `--test` argument to the command and see the resulting metrics directly. Then please update your post with what you have and what you expect to have. – Hipska Sep 28 '22 at 10:29

0 Answers0