Splunk Search

How can i use Global Time Picker in my search

gauravkumar85
Path Finder

 I have dataset which have field INSERT_DATE now i want to perform search based the date which is match with Global Time Picker

gauravkumar85_0-1732814482612.png

Search what i want to is 

index = ******* host=transaction source=prd | spath
| mvexpand message
| rename message as _raw
| fields - {}.* ``` optional ```
| spath path={}
| mvexpand {}
| fields - _* ``` optional ```
| spath input={}
| search TARGET_SYSTEM="EAS"
| eval _time=strptime(INSERT_DATE, "%m/%d/%Y")
| chart sum(TRANSACTION_COUNT) as TRANSACTION_COUNT by INSERT_DATE
| where INSERT_DATE =strftime($global_time.latest$, "%m/%d/%Y")  

0 Karma
1 Solution

PickleRick
SplunkTrust
SplunkTrust

I think @marnall meant

| where _time=info_max_time

(Or whatever other meta field) instead of eval.

View solution in original post

PickleRick
SplunkTrust
SplunkTrust

The $notation$ is only used within dashboards and with map command and it's substituted with a value before a (sub)search is spawned. The normal search interface doesn't have this functionality. You need to use @marnall 's way to add the search metadata to the results.

0 Karma

marnall
Motivator

You could use the addinfo command then use the info_min_time field to contain the epoch time of your earliest time boundary in your time picker:

<your search>
| addinfo
| eval _time = info_min_time

gauravkumar85
Path Finder

i modified my search  but not getting any result 

index = ****** host=transaction source=prd | spath
| mvexpand message
| rename message as _raw
| fields - {}.* ``` optional ```
| spath path={}
| mvexpand {}
| fields - _* ``` optional ```
| spath input={}
| search TARGET_SYSTEM="EAS"
| chart sum(TRANSACTION_COUNT) as TRANSACTION_COUNT by INSERT_DATE
| addinfo
| eval _time =info_min_time
| where INSERT_DATE=_time

My ROW Data:

[{"ID":"115918","TARGET_SYSTEM":"EAS","REVIEW":"CPW_00011H","TOTAL_INVENTORY":0,"TOTAL_HITS":0,"TRANSACTION_TYPE":"MQ","TRANSACTION_NAME":"HO620I","TRANSACTION_COUNT":4,"PROCESS_DATE":"11/26/2024","INSERT_DATE":"11/27/2024"}
,{"ID":"115919","TARGET_SYSTEM":"EAS","REVIEW":"CPW_00011H","TOTAL_INVENTORY":0,"TOTAL_HITS":0,"TRANSACTION_TYPE":"MQ","TRANSACTION_NAME":"HO626I","TRANSACTION_COUNT":39,"PROCESS_DATE":"11/26/2024","INSERT_DATE":"11/27/2024"}]

When i am not using where condition its giving me data. 

index = **** host=transaction source=prd | spath
| mvexpand message
| rename message as _raw
| fields - {}.* ``` optional ```
| spath path={}
| mvexpand {}
| fields - _* ``` optional ```
| spath input={}
| search TARGET_SYSTEM="EAS"
| chart sum(TRANSACTION_COUNT) as TRANSACTION_COUNT by INSERT_DATE
| addinfo
| eval _time =info_min_time 

gauravkumar85_0-1732820840869.png

 

0 Karma

PickleRick
SplunkTrust
SplunkTrust

I think @marnall meant

| where _time=info_max_time

(Or whatever other meta field) instead of eval.

gauravkumar85
Path Finder

finally its working . Thank you all for your help 

| mvexpand message
| rename message as _raw
| fields - {}.* ``` optional ```
| spath path={}
| mvexpand {}
| fields - _* ``` optional ```
| spath input={}
| search TARGET_SYSTEM="EAS"
| eval lookupfiledatestart =strftime(INSERT_DATE,"%m/%d/%Y") | addinfo | eval _time = strftime(info_min_time,"%m/%d/%Y")
| where _time=INSERT_DATE
| chart sum(TRANSACTION_COUNT) as TRANSACTION_COUNT by INSERT_DATE
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...