Splunk Search

How to edit my search to add a column with the total for each list(count) by a field?

rubeniturrieta
Communicator

Hi to everyone

I have this search:

sourcetype="cisco:asa" | stats count by src_ip,dest_ip | sort -count |  stats list(dest_ip),list(count) by src_ip

With this output:

alt text

I need to add a column with the total count by src_ip (sum of all the count for each list(count) value)

Does someone knows how to do this?

regards

0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Try something like this

 sourcetype="cisco:asa" | stats count by src_ip,dest_ip | sort -count | eventstats sum(count) as Total by src_ip |  stats list(dest_ip),list(count) values(Total) as Total by src_ip

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

Try something like this

 sourcetype="cisco:asa" | stats count by src_ip,dest_ip | sort -count | eventstats sum(count) as Total by src_ip |  stats list(dest_ip),list(count) values(Total) as Total by src_ip

rubeniturrieta
Communicator

Very well, it's working, thanks you very much!

0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...