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!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...