Splunk Search

Count of field and count of sources of the field

ehastings1982
Explorer

I have firewall logs coming in. I have a field which is the destination of traffic (dst). I would like to show the total count of the destination field and the count of the unique sources.

So the result would be:

Dst           Total Events     Sources
8.8.8.8        50              25
8.8.8.9        40              35
8.8.8.10       150             95
Tags (2)
0 Karma

ehastings1982
Explorer

Im guessing this was the best way.

0 Karma

ehastings1982
Explorer

I think this does it. Ive done some checks and it appears the numbers line up. Is there a better way or more efficient query I could have written?

dst=* | stats count(dst), dc(host) by dst | sort -num("dc(host)") | rename dst as "Destination IP", count(dst) as "Total Count", dc(host) as "Total Locations"
0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...