Splunk Search

How to not evaluate something during a certain time period?

kdimaria
Communicator

So, I have a search query that calculates a field but I wanted to know if there is a way to check if it is a certain time period and then to not calculate that field. I have a start time and end time: for example: 10/13/2017 12:10:00 and end time 10/20/2017 14:20:00. And I wanted to change the eval so that if the current time matches that time field then to make a different calculation than what its currently calculating. Basically eval field=if("in time frame",new calculation, old calculation)

Thanks

0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi kdimaria,
you could try something like this (if my_time is the field name in your logs but not _time):

| eval field=if(my_time>earliest AND my_time<latest,new calculation, old calculation)

Bye.
Giuseppe

View solution in original post

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi kdimaria,
you could try something like this (if my_time is the field name in your logs but not _time):

| eval field=if(my_time>earliest AND my_time<latest,new calculation, old calculation)

Bye.
Giuseppe

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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...