Splunk Search

How to create a search for date compare to get the exact output?

renuka
Path Finder

renuka_0-1596532169866.png

I am trying on date compare but i am unable to get the exact output

The condition for Date Compare:

if(First_Date.before(Verifed_Date ) consider the value as 1,
else if(First_Date.equals(Verifed_Date ) consider the values as 0,
else consider the r value as 2;
if D2_ExecutionDate is null or empty mean verified should be null
Verified Condition is:

(Date Compare(Verifed_Date ,First_Date == 0 || Verifed_Date ,First_Date == 1)
&& (Verifed_Date ,Second_Date == 2 || Verifed_Date, Second_Date == 0))
get the verified values from PhaseMapping verified = R06.1

For reference i attached a screenshot..please help me with this

Thanks in advance

Renuka

Labels (1)
Tags (1)
0 Karma
1 Solution

thambisetty
SplunkTrust
SplunkTrust

For date comparison, you should first convert any date format to epoch. Then you can compare.

share complete raw event with field names. 

————————————
If this helps, give a like below.

View solution in original post

0 Karma

bowesmana
SplunkTrust
SplunkTrust

You are comparing strings by quoting the field names in the case statement. Remove the quotes then you will compare fields, not the string values, i.e.

| eval DateCompare=case(First_Date<verified_Date,1,...)

 Also make sure the OR and AND boolean operators are in CAPS, not lower case as in your screenshot.

 

0 Karma

thambisetty
SplunkTrust
SplunkTrust

For date comparison, you should first convert any date format to epoch. Then you can compare.

share complete raw event with field names. 

————————————
If this helps, give a like below.
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to July and August Tech Talks, Office Hours, and Webinars!

Dive into our sizzling summer lineup for July and August Community Office Hours and Tech Talks. Scroll down to ...

Edge Processor Scaling, Energy & Manufacturing Use Cases, and More New Articles on ...

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

Get More Out of Your Security Practice With a SIEM

Get More Out of Your Security Practice With a SIEMWednesday, July 31, 2024  |  11AM PT / 2PM ETREGISTER ...