Splunk Search

Generating a daily, weekly and monthly report for indexed volume usage by all indexes and all servers.

mike7860
Explorer

I would like to generate a daily, weekly and monthly report for indexed volume usage by all indexes and all servers. I would like to add the usage daily , weekly and monthly as three individual columns. Is it possible to merge the results in splunk search head? I generated a report for daily indexed volume usage, but unable to add a column comparing the indexed usage weekly, monthly etc.

Tags (1)
0 Karma

sowings
Splunk Employee
Splunk Employee

I'd approach this by using eventstats. I'd create fields by using strftime using %m for month, and %U (or %V or %W—see man pages for which you prefer) for week (number). Then, another for %j for day number. Next, I'd use eventstats to sum or count or whatever "by day_number', then "by week_number", then finally another invocation for "by month". You're required to use an "AS" clause with eventstats, so ultimately, your search might look like this:

<your search>
| eval day_no=strftime(_time, "%j")
| eval week_no=strftime(_time, "%U")
| eval month_no=strftime(_time, "%m")
| eventstats sum(kb) AS daily by day_no
| eventstats sum(kb) AS weekly by week_no
| eventstats sum(kb) AS monthly by month_no
<display functions>

The event set would carry day_no, week_no and year_no fields along with every event, so you'd have those numbers available to pass to chart or timechart or stats.

0 Karma

sowings
Splunk Employee
Splunk Employee

Er, sorry, I misread monthly as yearly. Edited the above to reflect that change.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...