Splunk Search

search query for line graph

elaine0102
Explorer

earliest=-30d@d-1h latest=-1d@d+11h

| bucket _time span=24h

| stats sum(eval(if((date_hour>=23) OR (date_hour<11),1,0))) as TimeWindowCount by _time

| rename TimeWindowCount as "events"

Hi, above is my search for line graph to display my past 30 days events. However, the above only return me about 15 days.

Any one knows whats wrong? Or even better if I can search for the whole month of the previous month (meaning now is November, my line graph would display the whole of October events)

Tags (1)
0 Karma
1 Solution

kristian_kolb
Ultra Champion

Would that do?

earliest=-1mon@mon latest=@mon

Hope this helps,

Kristian

View solution in original post

kristian_kolb
Ultra Champion

Would that do?

earliest=-1mon@mon latest=@mon

Hope this helps,

Kristian

Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...