Splunk Search

The latest event for each IP address

ritazreiby
New Member

i have a list of events , sorted by ip addresses , i would like to see only the latest event for each ip, i tried using head 1 but then it shows me only one IP with all its events, any suggestions?

BGP AND ((neighbor down) OR (neighbor up)) | rex "(?\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})" | stats count by IP_add

Tags (3)
0 Karma
1 Solution

sdaniels
Splunk Employee
Splunk Employee

If you know how many hosts you are looking at then you could do it this way:

 <your search> | dedup IP_add | head X

I think this will show you the latest event for each IP_add. Just replace X with the number of IP addresses that you should be looking at.

View solution in original post

0 Karma

sdaniels
Splunk Employee
Splunk Employee

If you know how many hosts you are looking at then you could do it this way:

 <your search> | dedup IP_add | head X

I think this will show you the latest event for each IP_add. Just replace X with the number of IP addresses that you should be looking at.

0 Karma

ritazreiby
New Member

thanks !! works just fine !!

0 Karma
Get Updates on the Splunk Community!

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...