Dashboards & Visualizations

How to edit my search to create a dashboard that displays an event count per hour with weekly total?

jtracy
Engager

Hello, I have the following simple query;

index="myindex" source="*sourcelog.txt" "KEYWORD"

This search returns about 90,000 events over a given week with "KEYWORD" in it. How can I create a dashboard that shows me how many events per hour and day over that week, along with a running weekly total?

Thanks in advance for your help guys.

0 Karma
1 Solution

sundareshr
Legend

Like this

index="myindex" source="*sourcelog.txt" "KEYWORD" earliest=-7d@d | timechart span=1h count | accum count

View solution in original post

0 Karma

sundareshr
Legend

Like this

index="myindex" source="*sourcelog.txt" "KEYWORD" earliest=-7d@d | timechart span=1h count | accum count
0 Karma

jtracy
Engager

This is close.

This shows a contiguous count spanning across 7 days. I would like an individual count per hour and then a summation of all counts per week. Is this possible?

0 Karma

sundareshr
Legend

Are you showing more than 1 week's worth of data?

0 Karma

jtracy
Engager

No, I am limiting the search to "Week To Date"

0 Karma

sundareshr
Legend

So what do you want for summation per week? Just the total for the entire week? Would that be total of count? Do you want the summation at the bottom or as an additional field? For summation at the bottom, add this to the end of the query

... | addcoltotals labelfield=_time label="Week Total"

If you want as an additional field, add this to the end

... | eval wknum=strftime(_time, "%U") | eventstats sum(count) as wk_total by wknum | fields - wknum
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...