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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...