Dashboards & Visualizations

How to display the label from the time field token from the time picker?

dbcase
Motivator

Hi,

I would like to display the label from the time field token from the time picker. I can display the value by using (timefield).earliest but it shows up as -24h@h which is sorta readable but not as good as Last 24 hrs. How can I display the label vs the value?

0 Karma
1 Solution

niketn
Legend

@dbcase case, please refer to one of my recent answers. Hope you are looking for the same: https://answers.splunk.com/answers/633356/whats-the-token-name-for-the-time-pickers-display.html

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

niketn
Legend

@dbcase case, please refer to one of my recent answers. Hope you are looking for the same: https://answers.splunk.com/answers/633356/whats-the-token-name-for-the-time-pickers-display.html

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

dbcase
Motivator

Hi Niketnialy,

This one worked perfect

  <input type="time" searchWhenChanged="true">
       <label>Enter time range</label>
       <default>
         <earliest>-1d@d</earliest>
         <latest>@d</latest>
       </default>
       <change>
         <set token="displayTime">($label$)</set>
       </change>
     </input>
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 ...