Creating a Visualization from JSON data

Explore - I can find the data from my Caddy webserver in my grafanacloud-username-log. It is json format in /var/log/caddy.log
However, I am not having any luck creating a visualization.

I’d like to get a list of the top requests by IP (so, a count of the top 10 IPs that have hit my server over the time range)

the IP is duplicated in “remote_ip”: “192.168.1.1” o or “client_ip”: “192.168.1.1”

Can someone point me to a video doing something similar, or help me with the steps?
Thank you!

Welcome @bjarvis1 to the Grafana community forum.

The best data source to use to visualize JSON data is called the Infinity data source. It’s a little bit tricky to use because it is so powerful, so maybe you could post a sample of your JSON data here and we can help you visualize it using that data source.

Actually, maybe I misread your question. Can you tell us what your data source is that has been successful in visualizing your Caddy data?

Hi, Grant - I was successful in finding the logs using Explorer. But trying to build a panel I didn’t really understand what was being asked for in every field or just how to build my query.

I tried uploading a 2-line sample, but “new users” cannot upload files, and pasting the 2 lines in the message was disallowed because there were more than 2 links in them.

So, Best way to get someone sample data and maybe help?

Thank you!
Bryan

Let’s back up…

Set up Grafana Cloud account, correct?
Datasource that you installed?
Are you trying to view logs or metrics or both?
Is your Caddy webserver self-hosted (on prem) or cloud-hosted?

Hi, Grant.

Yes, Grafana Cloud account
I installed Alloy on my servers, configured it to send /var/log/*.log,
which includes /var/log/caddy.log.
Trying to visualize caddy log information, specifically (to get started)
count of Top 10 IPs that hit my caddy instance.

Caddy is self-hosted on prem.

It’s a hobby website for fun, but I’m curious - thus the dashboard I want
to set up.

Example of the json key:value pair I’m wanting to get started with is “client_ip”: “51.222.253.17”

Does that help?
Thanks again!

alloy is scrapping this data to what backend?

as POC i would just copy the content of file and visualize it using inline json with infinity.

Alloy is scraping the data from my local ubuntu server (/var/log/*.logs) as well as linux stuff and sending it to my gfafana cloud instance. I’m seeing linux integration metrics on the pre-configured linux dashboards.

I have no clue how to visualize using infinity, I’ll have to google that and see where to go from there.

1 Like

I Just grabbed some sample Caddy log file from online.

can the final destination data you scrapped be accessed via an http endpoint?