Splunk Search

counting combination of fields

a212830
Champion

Hi,

How would I count a combination of fields in splunk? For example, I have a "from_ip_addr" and a "to_ip_addr" in an event, and I want to count unique combinations of those two.

Tags (1)
0 Karma
1 Solution

somesoni2
Revered Legend

Try this

your base search | stats count by from_op_addr, to_ip_addr | stats count

View solution in original post

somesoni2
Revered Legend

Try this

your base search | stats count by from_op_addr, to_ip_addr | stats count

a212830
Champion

Great. Thanks!

0 Karma

sssignals
Path Finder

It works for me! Thanks.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Leave the final stats off the first suggestion to get this:

your base search | stats count by from_op_addr, to_ip_addr
0 Karma

a212830
Champion

Thanks. Is there a way to get the combo's listed as well?

from_ip to_ip count

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Or this:

your base search | eval from_to = from_ip_addr.to_ip_addr | stats dc(from_to)
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...