Viewing JSON data from file in Grafana with or without DB?

I’m currently learning about Grafana and databases. I’m am not anywhere near proficient at either. What I have is a json file with a bunch of data in it that looks like this:

{“camera”: “192.168.131.26”, “data”:
[{“people_count”: {“enter”: 0, “leave”: 0}, “timestamp”: “2020-05-00 00:10:56.560010”},

Plus about 47000 more lines. :slight_smile:

I just want to visualize this data within a grafana dashboard, but I am not sure of the best way to do this. I thought about NoSQL using MongoDB and created all of the entries, but Grafana requires a subscription for this. Wondering if there is a way to get Grafana to just read directly from the file or any other suggested way of doing this, Again, I’m completely new to all of this and would really appreciate any direction. Thanks

Have you investigated

Antony.

Or Grafana Infinity Datasource

Hey there @svetb , I decided to try infinity one first as it looked promising from the start. I was able to input my data into the field as shown by the examples. However, when I run the dashboard, it says there is no data to display. Have you used this plugin and have you had any issues like the one I am mentioning? Any thoughts on this? I know I am probably doing something wrong here. Thanks in advance.

Hey there, Antony. I’m tryng the Grafana Infinity Datasoure first, but will try the simpleJSON if I am unable ot get it to work. I appreciate the suggestion and will let you know what I find.

Hi @tdickson Here is gist of how you achieve this with infinity datasource.

[
  {
    "people_count": { "enter": 0, "leave": 0},
    "timestamp": "2020-05-01 00:10:56.5600010"
  },
  {
    "people_count": { "enter": 2, "leave": 0},
    "timestamp": "2020-05-01 00:12:56.5600010"
  },
  {
    "people_count": { "enter": 5, "leave": 2},
    "timestamp": "2020-05-01 01:10:56.5600010"
  }
]

Hey there, @yesoreyeram I am really glad you jumped in on this as I think you have the most knowledge on this plugin. I tried your suggestion, but am still getting the No data alert. Here is how it is configured. I have added 10k lines and checked to make sure all are formatted as you mentioned. Am I doing something wrong? I am doing this on a local instance, btw.

@yesoreyeram nevermind. You fixed it. I decided to try another dashboard from scratch and the data is now showing. I really appreciate your time on this and your explanation was truly helpful. I will mark your answer as a solution. Stay safe :slight_smile:

1 Like