Splunk Search

How to use comparison operators in a search to match field value condition?

gajananh999
Contributor

Hello Everyone,

i want to check one condition in splunk and if that condition match and then i need to get those events who matches condition else result should be null

LAST < sysdate - (1/(2*24)) 

LAST is one field in splunk and can one help me out here.
for sysdate -(1/(2*24)) i have done eval tnow = now() | eval finalvalue=tnow-0.0208333333333333

so now i have to check the LAST < finalvalue

I have tried this

search string  |eval tnow = now()  | eval finalvalue=tnow-0.0208333333333333| eval Severity=if(LAST < finalvalue,NODE,null()) | table Severity,NODE

when i am doing this if condition doesn't match also it is creating table with first field as null.

Can anyone help me out here

Thanks

 

0 Karma
1 Solution

gajananh999
Contributor

Hello Everyone i have used where condition LAST > finalvalue

View solution in original post

0 Karma

gajananh999
Contributor

Hello Everyone i have used where condition LAST > finalvalue

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...