Grafana Elastic Failed to display Node graph

Hello, I would like to display node graph in my dashboard using ElasticSearch as the data source. I tried to push into an index with this data that was made based on the documentation in Node graph | Grafana documentation

But the thing is, the data is not shown. I am currently using Grafana v9.1.7 and ElasticSearch 8.4.2

This is the sample JSON data that I push to ElasticIndex. Is there any example that I can use?

{
	"nodes": [
		{
			"id": "node1",
			"title": "Command 1",
			"subtitle": "Subtitle 1",
			"mainstat": "Node1",
			"detail_mitre": "T0000",
			"time": "2022-07-15T05:50:02+0000"
		},
		{
			"id": "node2",
			"title": "Command 2",
			"subtitle": "Subtitle 2",
			"mainstat": "Node2",
			"detail_mitre": "T0001",
			"time": "2022-07-15T05:50:07+0000"
		},
		{
			"id": "node3",
			"title": "Command 3",
			"subtitle": "Subtitle 3",
			"mainstat": "Node3",
			"detail_mitre": "T0001",
			"time": "2022-07-15T05:50:10+0000"
		},
	],
	"edges": [
		{
			"id": "relationship1",
			"source": "node1",
			"target": "node2",
			"time": "2022-07-15T05:50:04+0000"
		},
		{
			"id": "relationship2",
			"source": "node2",
			"target": "node3",
			"time": "2022-07-15T05:50:08+0000"
		}
	]
}
1 Like

Hi, i have same question. did you manage to make it work ?

regards

Hello,

using infinity plugin to mock elastic this is what I get.

and hitting directly the opensearch api url to port 9200 using infinity plugin

Hi, thanks a lot for your reply.

Ok will try with Elasticsearch, on your last screenshot i assume that index is “grafana”

thanks again

1 Like

yep just a sample index called grafana/ I just cannot do it using lucene query to extract the data out as nodes and edges.


Finally, was able to make it work using “Nodes - Node Graph” and “Edges - Node Graph”

really interesting

3 Likes

would be cool to know how to do it with lucene query but not my forte. infinity is amazing!

@yesoreyeram

Hello. How did you relate Nodes and Edges. I Can visualize Nodes with statistics

or Edges without statistics

I use an url (request to elastic server) to get nodes and values, but an inline file to edges.