Splunk Search

How to filter on DC after applying stats?

jwalzerpitt
Influencer

I have the following search in which I am looking for a list of each source IP, the list of websites they hit, the count of GETs per website, and then an overall total of GETs for all websites

index=foo http_method=GET
| bucket _time span=5m
| stats count by src, website
| sort -count 
| where count >= 5
| stats list(website) as Website, list(count) as count, sum(count) as Total by src 
| sort -Total

How can I modify the search to query for only IPs that have hit more than 5 websites within the 5-minute time span?

Thx

0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Give this a try

index=foo http_method=GET
| bucket _time span=5m
| stats count by src, website
| sort -count 
| where count >= 5 | evenstats dc(website) as sites by src | where sites>=5
| stats list(website) as Website, list(count) as count, sum(count) as Total by src 
| sort -Total

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

Give this a try

index=foo http_method=GET
| bucket _time span=5m
| stats count by src, website
| sort -count 
| where count >= 5 | evenstats dc(website) as sites by src | where sites>=5
| stats list(website) as Website, list(count) as count, sum(count) as Total by src 
| sort -Total

jwalzerpitt
Influencer

Aweomse - worked perfectly!

Thx

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...