Splunk Search

Last record per hour

627412
New Member

I manage to extract the data from Splunk below:
ID SignalStrength TimeStamp
01 3 09:00:05
01 0 09:30:00
02 0 09:00:05
02 0 09:30:00
02 3 09:55:00

But I wanted to reduce it further to only get the last record in the hour, like this:
ID SignalStrength TimeStamp
01 0 09:30:00
02 3 09:55:00

I tried this:
| stats max(Timestamp) by ID, SignalStrength

but it gave me the maximum on the day not per hour.

Tags (1)
0 Karma

manjunathmeti
Champion

Try this:

| bin _time span=1h | stats max(Timestamp) by ID, SignalStrength, _time
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 ...