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!

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...