Infinity Plugin: Nested JSON with "." in keys

  • What Grafana version and what operating system are you using?
    Hosted version

  • What are you trying to achieve?
    Parse a nested JSON with “.” characters in the JSON keys

  • How are you trying to achieve it?
    Infinity plugin

  • What happened?
    Parsing not working.

  • What did you expect to happen?
    Parsing should work.

  • Can you copy/paste the configuration(s) that you are having problems with?


  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    no

  • Did you follow any online instructions? If so, what is the URL?
    Grafana Infinity Datasource

Please post sample data

Please check the entries "measurements":{"numeric":{"value.common.engine.fuel.level":{"time":1658585975000,"value":6.0}},

I want to extract the entries for “value” as column:

[
  {
    "id": "131899",
    "name": "Bus",
    "serial": "1950004",
    "pin": "PE358887095828834",
    "vin": "PE358887095828834",
    "organization": {
      "id": "29e41428-d249-41d8-8c6a-81e76d5e2d54",
      "name": "Company Cars",
      "type": "dealer"
    },
    "communicationUnits": [
      {
        "id": "358887095828834",
        "name": "358887095828834",
        "state": "live",
        "cuType": "clm"
      }
    ],
    "model": {
      "id": "9e8730b0-d2d5-4a17-85be-5d3ae03e1fee",
      "name": "C-Class",
      "assetType": {
        "key": "5b3513d1-b411-38e3-a348-35e428702494",
        "label": "Transport"
      }
    },
    "geo": {
      "time": 1664715854485,
      "longitude": 8.436395667,
      "latitude": 51.634282333,
      "timeZone": "Europe/Berlin",
      "continent": {
        "code": "EU",
        "name": "Europe"
      },
      "country": {
        "code": "DE",
        "name": "Germany"
      }
    },
    "measurements": {
      "numeric": {
        "value.common.engine.fuel.level": {
          "time": 1658585975000,
          "value": 6
        }
      },
      "string": {}
    },
    "status": "offline",
    "activity": {
      "lastContactAt": 1668492316379,
      "lastDatapointAt": 1668492308000
    },
    "oemName": "Mercedes-Benz"
  },
  {
    "id": "127991",
    "name": "[Terminated] Demo Device MaGl",
    "serial": "1932003",
    "pin": "I0358887095823520",
    "vin": null,
    "organization": {
      "id": "a8c647d1-3aa4-436f-a256-083f585c2cc5",
      "name": "[ExternalDemo] Merino Op II",
      "type": "oem"
    },
    "communicationUnits": [
      {
        "id": "358887095823520",
        "name": "358887095823520",
        "state": "terminated",
        "cuType": "clm"
      }
    ],
    "model": {
      "id": "100cc1dd-2e0b-4a7e-ac0a-90e4a5a3200b",
      "name": "Inventory"
    },
    "geo": {
      "time": 1656399233000,
      "longitude": 9.6274724,
      "latitude": 50.5486344,
      "timeZone": "Europe/Berlin",
      "continent": {
        "code": "EU",
        "name": "Europe"
      },
      "country": {
        "code": "DE",
        "name": "Germany"
      }
    },
    "measurements": {
      "numeric": {
        "value.common.engine.fuel.level": {
          "time": 1654865089000,
          "value": 23
        }
      },
      "string": {}
    },
    "status": "offline",
    "activity": {
      "lastContactAt": 1668492317485,
      "lastDatapointAt": 1668492308000
    },
    "oemName": "Merino Op"
  },
  {
    "id": "131917",
    "name": "FD - PE 3005",
    "serial": "1950006",
    "pin": "PE358887095828735",
    "vin": "PE358887095828735",
    "organization": {
      "id": "50403ffe-79a7-4cf1-acd7-da114e92b648",
      "name": "[Dist] Proemion",
      "type": "distributor"
    },
    "communicationUnits": [
      {
        "id": "358887095828735",
        "name": "358887095828735",
        "state": "live",
        "cuType": "clm"
      }
    ],
    "model": {
      "id": "9e8730b0-d2d5-4a17-85be-5d3ae03e1fee",
      "name": "C-Class",
      "assetType": {
        "key": "5b3513d1-b411-38e3-a348-35e428702494",
        "label": "Transport"
      }
    },
    "geo": {
      "time": 1669570472000,
      "longitude": 11.3598317,
      "latitude": 44.8365667,
      "timeZone": "Europe/Rome",
      "continent": {
        "code": "EU",
        "name": "Europe"
      },
      "country": {
        "code": "IT",
        "name": "Italy"
      }
    },
    "measurements": {
      "numeric": {
        "value.common.engine.fuel.level": {
          "time": 1665907141000,
          "value": 23
        }
      },
      "string": {}
    },
    "status": "offline",
    "activity": {
      "lastContactAt": 1669571879385,
      "lastDatapointAt": 1669570472000
    },
    "oemName": "Mercedes-Benz"
  },
  {
    "id": "118993",
    "name": "Demo Device Korea #2 SN1903205",
    "serial": "1903205",
    "pin": "PROEMION001903205",
    "vin": "PROEMION001903205",
    "organization": {
      "id": "b9468ebe-b014-4eb3-8402-48bc25c48739",
      "name": "Customer APAC 1",
      "type": "machine_owner"
    },
    "communicationUnits": [
      {
        "id": "358887090965722",
        "name": "358887090965722",
        "state": "live",
        "cuType": "clm"
      }
    ],
    "model": {
      "id": "e0c9ebde-9815-4234-82c1-7c67424db849",
      "name": "3-Series",
      "assetType": {
        "key": "fcfea81b-2291-daf6-9b70-62fcf1571199",
        "label": "Dump Truck"
      }
    },
    "geo": {
      "time": 1669639292000,
      "longitude": 127.0284061,
      "latitude": 37.4955028,
      "timeZone": "Asia/Seoul",
      "continent": {
        "code": "AS",
        "name": "Asia"
      },
      "country": {
        "code": "KR",
        "name": "South Korea"
      }
    },
    "measurements": {
      "numeric": {
        "value.common.engine.fuel.level": {
          "time": 1669626004000,
          "value": 24.4
        }
      },
      "string": {}
    },
    "status": "online",
    "activity": {
      "lastContactAt": 1669639385288,
      "lastDatapointAt": 1669639292000
    },
    "oemName": "Merino Op"
  }
]
1 Like

Something like this?

Thanks for the feedback.
Problem is that sometimes there is an enumeration of numeric measurements. In that case it does not work as proposed that there are multiple columns with the names “time” and “value”. Any ideas how this could be fixed?

 "measurements": {
            "numeric": {
                "value.common.machine.distance.total": {
                    "time": 1623660089000,
                    "value": 3.8
                },
                "value.common.machine.hours.operation.total": {
                    "time": 1623660089000,
                    "value": 1.26666768
                }
            },