Splunk Search

How to get the "COD SERIE CEI" which has no events between now and 2 hours ago?

raultav
Engager

Hi, guys!

I have an event table, which has a field called "COD SERIE CEI". I need to get the "COD SERIE CEI" which has no events between now and 2 hours ago.

index="raw_arq_cei" Titulo="NCEI Informativas"
| eval eventHour=strftime(_time,"%H")
| eval eventMin=strftime(_time,"%M")
| eval curHour=strftime(now(),"%H")
| eval curMin=strftime(now(),"%M")
| table Dados.COD_SERIE_CEI
| sort _time

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Finding something that is not there is not Splunk's strong suit.  See this blog entry for a good write-up on it.

https://www.duanewaddle.com/proving-a-negative/

Another approach is to look back more than 2 hours (like 4 or even 24) and see if the most recent event has a timestamp older than 2 hours.

index="raw_arq_cei" Titulo="NCEI Informativas" earliest=-4h
| stats latest(_time) by Dados.COD_SERIE_CEI
| eval timeSince=now()-_time
| where timeSince > 7200
| sort _time
| table Dados.COD_SERIE_CEI
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

It's not clear what problem you are trying to solve.  Are you looking for data that is at least 2 hours old or a lack or events in the last 2 hours or something else?

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

raultav
Engager

Hi Rich!

I edited my question.

I have an event table, which has a field called "COD SERIE CEI". I need to get the "COD SERIE CEI" which has no events between now and 2 hours ago.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Finding something that is not there is not Splunk's strong suit.  See this blog entry for a good write-up on it.

https://www.duanewaddle.com/proving-a-negative/

Another approach is to look back more than 2 hours (like 4 or even 24) and see if the most recent event has a timestamp older than 2 hours.

index="raw_arq_cei" Titulo="NCEI Informativas" earliest=-4h
| stats latest(_time) by Dados.COD_SERIE_CEI
| eval timeSince=now()-_time
| where timeSince > 7200
| sort _time
| table Dados.COD_SERIE_CEI
---
If this reply helps you, Karma would be appreciated.
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...