Dashboards & Visualizations

How to get the date and time of Time Range Picker Control?

mohanbangw
New Member

How to get the date and time of Time Range Picker Control?

<input type="time" searchWhenChanged="true" token="TIMERANGE">
      <label>SWIFT Time Range</label>
      <default>
        <earliest>@d</earliest>
        <latest>now</latest>
      </default>
</input>

I mean start date and end date in human readable format. It will be great if can get the startepoch and endepoch

0 Karma

sundareshr
Legend

There are couple of options within the query.

1) Use addinfo

your base search earliest=$TIMERANGE.earliest$ latest=$TIMERANGE.latest$ | addinfo | table info_min_time info_max_time

https://docs.splunk.com/Documentation/Splunk/6.4.3/SearchReference/Addinfo

*OR*

your base search | eval e=if(isnum($TIMERANGE.earliest$, $TIMERANGE.earliest$, relative_time(now(), $TIMERANGE.earliest$) | eval l=if(isnum($TIMERANGE.latest$, $TIMERANGE.latest$, relative_time(now(), $TIMERANGE.latest$)
0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

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