Splunk Search

Issues with Sum(count) not showing a number, but total being correct.

bworrellZP
Communicator

Have a search that gives data, for "yesterday" with specific criteria. Trying to show results by Location, with counts by user per location. I get the counts, but it sometimes does not show a count.

Search is this. (data changed to protect the innocent 🙂 )

index=location |search LockedStatus=Locked |rename UserAccountEntry as User |stats count by Location User | stats values(User) as User values(count) as PerUser_count sum(count) as Total by Location | sort 10 -Total

alt text

If you look at DEF, for the 1258452 there is not a 1 in the per user count. Thoughts on why? (this happens every day, though location or user is different).

Thanks

Tags (1)
0 Karma
1 Solution

sundareshr
Legend

values has an implicit dedup. Since both counts are 1, its gets deduped. Try using list instead.

index=location |search LockedStatus=Locked |rename UserAccountEntry as User |stats count by Location User | stats list(User) as User list(count) as PerUser_count sum(count) as Total by Location | sort 10 -Total

View solution in original post

0 Karma

sundareshr
Legend

values has an implicit dedup. Since both counts are 1, its gets deduped. Try using list instead.

index=location |search LockedStatus=Locked |rename UserAccountEntry as User |stats count by Location User | stats list(User) as User list(count) as PerUser_count sum(count) as Total by Location | sort 10 -Total
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...