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
---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma
Get Updates on the Splunk Community!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...