Splunk Search

counting help

splunk_gs
Explorer

i have a field called "Status" which contains "fresh" or "stale" which is distinct via host
I want to do a distinct count by status in one row

the "fresh" count is 20
the "stale" count is 1

i tried doing stats count(eval(status="fresh")) AS fresh1 count(eval(status="stale")) AS stale1 by host
it continues to give me "1" for the "fresh" count when it should be 20.

The only way this works is if i do stats count(eval(freshness="Fresh")) AS fresh1 by status.
The problem is that it splits it in two rows. I need the answers in one row.

Please Help

Tags (1)
0 Karma

Ayn
Legend

Couldn't you just do

... | chart count by host,status

?

Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...