Splunk Search

How do I edit my search to get a total sum of list(count)?

mikesangray
Path Finder

I've got this search working to show me allowed (!=blocked) network activity that lists the dest_ip, and dest_port, grouped by src with a count for each. Now I just want to get the total number of hits so I can eventually sort by highest hit count per individual src.

How can I get the total? I'm assuming I would use the list(count) column numbers, but no luck so far.

index=firewall action!=blocked src={your.ip.address}
|stats count by src,dest_port,dest_ip |stats list by src
Tags (4)
0 Karma

knielsen
Contributor

Hi,

If I understood correctly, you simply need to use it like this:

index=firewall action!=blocked src={your.ip.address}
 |stats count by src,dest_port,dest_ip |stats list sum(count) by src

Hth,
Kai.

0 Karma

somesoni2
Revered Legend

Try something like this

 index=firewall action!=blocked src={your.ip.address}
 |stats count by src,dest_port,dest_ip | eventstats sum(count) as count_src by src | sort 0 src count_src dest_port dest_ip

mikesangray
Path Finder

hm...no, with that string I lose my grouping. I'm working with this for now. Not ideal, but I'm getting the data I want.

index=firewall action!=blocked src={your.ip.address}
|stats count by src,dest_port,dest_ip |eventstats sum(count) by dest_ip |stats list by src

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...