Splunk Dev

Time Picker into Query

msachdeva3
Explorer

I have a query where I'm using

time() - _indextime,
1. but I want to be using what the user has selected from time range picker
2. if time picker local time is different from index time, how to make sure that is cordinated & used instead of what the server time.

Tags (1)
0 Karma
1 Solution

woodcock
Esteemed Legend

Use now() instead of time().

View solution in original post

0 Karma

woodcock
Esteemed Legend

Use now() instead of time().

0 Karma

somesoni2
Revered Legend

Without seeing your full search, to see what exact calculations are being performed, I can only say that, you can use command addinfo to get the value from timerange picker to your search result. Example,

index=_internal sourcetype=splunkd | addinfo | table _time info_min_time info_max_time 

The two (out of 4 total) fields that this command adds, info_min_time which contains the earliest and info_max_time contains the latest value of time range picker. See this for more information on this command.

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...