Dynamic Elasticsearch JSON and Grafana table panel

I have a JOSN which is dynamically updated by a incident management script hourly. I need to display those data in a Grafan table.

Ex - Time X

 {     "name" : "device1",
	   "incident_data": {
		   "issue1": "XXX1",
		   "issue2": "XXX2",
 		   "issue3": "XXX3"
 	}
}

Time X+1h

{ 
       "name" : "device1",
 	   "incident_data": {
 		        "issue1": "XXX1",		
 		        "issue3": "XXX3",
                "issue5": "XXX5",
                "issue4": "XXX4"
 	}
 }

I want to display these data in a Grafana table dynamically.

On Time X, table should be

Filter device1

issue1 XXX1
issue2 XXX1
issue3 XXX1

On Time X + 1h, table should be

Filter device1

issue1 XXX1
issue3 XXX1
issue4 XXX1
issue5 XXX1

Is this possible to do in Grafana? issue# is not a fixed field in my JSON.

It is possible if you are prepared to do a little bit of programming. The simple json data source is a way of returning JSON data from any data source.

Here is an example backend: https://github.com/bergquist/fake-simple-json-datasource

1 Like