Splunk Search

Search to show me events that have timestamps out by a lot

robnewman666
Path Finder

Hello,

I have the following search but I want it to show me the delay less and more out by more than 1 hour in a better way:

index=av
| eval index_time=_indextime, event_time=_time
| eval delay=round((_indextime - _time)/60, 0)
| convert ctime(index_time) ctime(event_time)
| where delay<3600 OR delay>3600
| sort - index_time
| table event_time index_time delay

Labels (3)
Tags (3)

ITWhisperer
SplunkTrust
SplunkTrust
| eval hourdelay=if(delay>3600,"more than 1 hour", "less than 1 hour")

richgalloway
SplunkTrust
SplunkTrust

Better how?

The current query converts the delay time from seconds to minutes and then filters out anything less than 3600 minutes (2.5 days).

---
If this reply helps you, Karma would be appreciated.

scelikok
SplunkTrust
SplunkTrust

Hi @robnewman666,

You can use tstats version

| tstats count where index=av by _indextime _time
| eval delay=abs(_indextime-_time)
| where delay > 3600
| eval index_time=_indextime
| convert ctime(index_time)
| table _time index_time delay

which will run much faster;

 

If this reply helps you an upvote and "Accept as Solution" is appreciated.

robnewman666
Path Finder

Thanks, this does look better, so will try tomorrow. Thanks @scelikok! 🙂

Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...