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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Self-Healing Pipeline Is Now Generally Available: AI-Powered CIM Compliance

Maintaining data integrity across security and analytics pipelines is an ongoing challenge. Data ...

[Puzzles] Solve, Learn, Repeat: Family Trees

This puzzle (first published here is based on finding grandparents and grandchildren (inspired by a question ...

Break the Build: Inside the KubeDoom Lounge at .conf26

    You step up to the machine. The pixelated corridors of a certain 1993 FPS load in front of you, EMP Pulse ...