Splunk Search

Filtering the results in Dashboard from InputLookup Depend Upon Time

cchange
Path Finder

Hi,

I'm trying to filter the results of the lookup depend upon the time selection from the dashboard. I have date field in the lookup. Below is the sample of the lookup.

ReportedAt Id status
2020-04-09 5:00:00 567 Pass

I'm trying with below logics but it is not working.

|inputlookup file.csv
|eval timeep = strptime('ReportedAt', "%Y-%m-%d %H:%S")
| addinfo
| where timeep > info_max_time and timeep < info_min_time

====
inputlookup file.csv | where Reportedat > $t1.earliest$ and Reportedat < $t1.latest$

Can you please let me know is there a way to display the results depend upon time selection in the dashboard.

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The first method should work, except the strptime format string is incorrect. Try |eval timeep = strptime('ReportedAt', "%Y-%m-%d %H:%M:%S").
The second method won't work because Splunk can't compare dates in string format.

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

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The first method should work, except the strptime format string is incorrect. Try |eval timeep = strptime('ReportedAt', "%Y-%m-%d %H:%M:%S").
The second method won't work because Splunk can't compare dates in string format.

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

cchange
Path Finder

Thanks Rich, I overlooked the syntax. Problem is with my where clause. I used logic wrongly and it is not matching filter condition. After correcting my logic, results started to display correctly for first method.

Thanks for your help once again.

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!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

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

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 ...