Splunk Search

How to make eventstats results persistent?

drosse
New Member

I am using event stats to get a unique count of the number of different values that are present in a given field. However the specific field that I am counting on changes based on the sourcetype. The eventstats commands I have look something like this (there are several hundred in total so it's not feasible to do manually)

sourcetype=123    | eventstats dc(file_path) as uniqueCount
sourcetype=456    | eventstats dc(hash_value) as uniqueCount

I need a way to be able to store the results of the eventstats command so that it is appended to the original event and I am able to retrieve it for use in dashboards. I tried using collect and sistats and neither one stores the "uniqueCount" value.

Thanks

Tags (1)
0 Karma
Get Updates on the Splunk Community!

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 ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...