Dashboards & Visualizations

How to create a Dashboard?

revanthammineni
Path Finder

Hi Splunkers,

I’m working on a Dashboard panel where I have to create a monthly wise data as shown in the screenshot. 
I have a field called “age group” and corresponding month’s data. But every month’s data comes from an external lookup file.

Data for example:


Age Group    Sept        July        Jun

30-90              235          0             34

90-180          1757        2168     3467

180+              19374     20,534  12,661
 I’m using this below code but it’s not actually working for me. Please help me with the logic to produce the chart like as it was in the screenshot. TIA

 
|inputlookup september.csv
|stats count by "Age Group"
|eval _time=strptime("2022-09-01","%Y-%m-%d")
|append [|inputlookup july.csv
|stats count by "Age Group"
|eval _time=strptime("2022-07-01","%Y-%m-%d")]

|chart count by _time, “Age Group” 

Labels (3)
0 Karma

revanthammineni
Path Finder

returning all 1’s in the statistics 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

OK, it sounds like your actual data already has the counts in?

This means that your example search would also have returned 1's

Try summing the counts (assuming the count column in your csv is called "count")

|inputlookup september.csv
|eval _time=strptime("2022-09-01","%Y-%m-%d")
|append [|inputlookup july.csv
|eval _time=strptime("2022-07-01","%Y-%m-%d")]
| chart sum(count) by _time "Age Group"

 It is often helpful and less time-consuming if you provide as much information about your problem as possible so we are not left guessing and end up providing incorrect solutions based on false assumptions.

ITWhisperer
SplunkTrust
SplunkTrust

There are mixed messages in your requirement - the example table you have shown gives the first column as age groups with dates as the subsequent columns, whereas the SPL and the screenshot would be give the first column as dates and subsequent columns as age groups.

For the first table, try this:

|inputlookup september.csv
|eval _time=strptime("2022-09-01","%Y-%m-%d")
|append [|inputlookup july.csv
|eval _time=strptime("2022-07-01","%Y-%m-%d")]
| chart count by "Age Group" _time

For the screenshot, try this:

|inputlookup september.csv
|eval _time=strptime("2022-09-01","%Y-%m-%d")
|append [|inputlookup july.csv
|eval _time=strptime("2022-07-01","%Y-%m-%d")]
| chart count by _time "Age Group"
0 Karma

revanthammineni
Path Finder

yeah, I’m trying to achieve the screen shot. But the  you’ve mentioned isn’t working unfortunately. 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

In what way is it not working?

0 Karma
Get Updates on the Splunk Community!

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...

Splunk App Dev Community Updates – What’s New and What’s Next

Welcome to your go-to roundup of everything happening in the Splunk App Dev Community! Whether you're building ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco + Splunk! We’ve ...