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!

What the End of Support for Splunk Add-on Builder Means for You

Hello Splunk Community! We want to share an important update regarding the future of the Splunk Add-on Builder ...

Solve, Learn, Repeat: New Puzzle Channel Now Live

Welcome to the Splunk Puzzle PlaygroundIf you are anything like me, you love to solve problems, and what ...

Building Reliable Asset and Identity Frameworks in Splunk ES

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