How to read arrays from JSON using Infinity datasource plugin

I used the Infinity plugin to make a call to REST API.
The following is the JSON response with timestamp (epoch) and values.

{
  "report": [
    {
      "timeWindow": {
        "entityEpochSecUTC": 1625788800,
        "entityTimeDurationSec": "SECOND",
        "entityTimeField": "kafka_ingestion_time"
      },
      "entity": {
        "entityType": "hive",
        "entityNamespace": "db",
        "entityName": "b_table",
        "entityInstance": "server-ams4",
        "dataAssetRef": "hive.db.b_table-v_1.0"
      },
      "reportItems": [
        {
          "checkName": "Check for cc info",
          "checkLevel": "Error",
          "checkStatus": "Success",
          "constraintName": "containsCreditCardNumber",
          "constraintStatus": "Success",
          "constraintMessage": "string"
        }
      ]
    }
  ]
}

I am unable to get the values under reportItems. I tried to do reportItems.checkStatus , reportItems[].checkStatus and reportItems[1].checkStatus

Apparently reportItems[1].checkStatus do work in Grafana, however i need it to get all the records and and not just the first record.

Any help would be great.

Hi, I guess the answer is a bit late but I’ll give you an answer anyway, for the record. You can do do it in two ways with the infinity datasource:

you can also use mv-expand to expand the array items in to row

parse-json
| scope "report"
| mv-expand "reportItem"="reportItems"
| project "ts"=unixtime_seconds_todatetime("timeWindow.entityEpochSecUTC"), "type"="entity.entityType", "check"="reportItem.checkName"