Splunk Search

How can I write a seach to get count of each application per day?

knarayana
New Member

I am looking for a search to get a count of each application per day. Below is the search I have now, which gives count for everything for that day. I need count per application per day.

index=index1 ...| bin span=1d _time | stats values(app) count(app) by _time

The result I get is below:

08/10/17    app1, app2, app3      total count of all 3 apps.

But what I want is this:

08/10/17         app1     count of app1
                 app2     count of app2
0 Karma

DalJeanis
Legend

Try this ...

 index=index1 ...| bin span=1d _time | stats count as appcount by _time app.

woodcock
Esteemed Legend

It is the count(app) thing that gets everybody. What we all should understand (and what is not taught anywhere) is that count(app) is actually count(eval(isnotnull(app))) which in the vast majority if cases simplifies down to being just count.

DalJeanis
Legend

Yeah, I avoid () with count whenever I can, especially when typing aircode. Figuring out what quotes are needed for evals in there is nontrivial at the moment. Write many, test many, post... well, usually twice...

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...