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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...