Splunk Search

I have to aggregate events in index by week and by month

snigdhasaxena
Communicator

I have tried using bin command but as
index=test| bin span=1w _time | chart count as total_count by _time, action

But this gives me event count over a span of 30days for every 7 days.

Please help me understand how to aggregate events in index by week and by month.

Tags (1)
0 Karma

renjith_nair
Legend

Try

index=test| eval week=strftime(_time,"%Y-%U")|eval month=strftime(_time,"%Y-%m")|chart count as total_count by week,month
Happy Splunking!
0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...