Splunk Search

need help with a query to get count and avg(count) per day

prakash007
Builder

I have given this query and it's just giving me avg(count) in the output, i'm looking for both count and avg(count) per day in the output.. any help would be appreciated. Thanks.

index=main host=src* source=ihs* | stats count by date_mday | stats avg(count)

Tags (1)
0 Karma

woodcock
Esteemed Legend

Like this:

index=main host=src* source=ihs* | bucket _time span=1d | stats count by _time | addtotals col=t row=f | fillnull value=TOTAL | streamstats current=f count AS serial | eval daily_average = if(_time = "TOTAL", count/serial, "vvvvvvvvvv") | fields - serial
Get Updates on the Splunk Community!

Enterprise Security Content Updates (ESCU) - New Releases

In the last month, the Splunk Threat Research Team (STRT) has had 3 releases of new content via the Enterprise ...

Thought Leaders are Validating Your Hard Work and Training Rigor

As a Splunk enthusiast and member of the Splunk Community, you are one of thousands who recognize the value of ...

.conf23 Registration is Now Open!

Time to toss the .conf-etti 🎉 —  .conf23 registration is open!   Join us in Las Vegas July 17-20 for ...