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.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...