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!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...