Dashboards & Visualizations

Simple XML, custom timerange dropdown sample?

the_wolverine
Champion

Please provide sample Simple XML for custom timerange dropdown. I do not want to allow users to select whatever timerange they please, like "All Time" Or "Year to Date".

1 Solution

the_wolverine
Champion
   <searchTemplate>index=_internal earliest=$earliest$ | head 10000</searchTemplate>

    <fieldset autoRun="true" submitButton="false">
            <input type="dropdown" token="earliest" searchWhenChanged="true">
              <label>Select a time:</label>
              <choice value="-4h@h">Last 4 hours</choice>
              <choice value="-12h@h">Last 12 hours</choice>
              <choice value="-24h@h">Last 24 hours</choice>
              <default>-4h@h</default>
            </input>
          </fieldset>

View solution in original post

the_wolverine
Champion
   <searchTemplate>index=_internal earliest=$earliest$ | head 10000</searchTemplate>

    <fieldset autoRun="true" submitButton="false">
            <input type="dropdown" token="earliest" searchWhenChanged="true">
              <label>Select a time:</label>
              <choice value="-4h@h">Last 4 hours</choice>
              <choice value="-12h@h">Last 12 hours</choice>
              <choice value="-24h@h">Last 24 hours</choice>
              <default>-4h@h</default>
            </input>
          </fieldset>

anwarmian
Communicator

Great Job!!!!

0 Karma

ben_leung
Builder

Can this be done without modifying the CSS or HTML in the back end? I would also like to have custom time ranges for a dashboard but without using advance XML.

0 Karma

the_wolverine
Champion

yes 🙂 I will post an example in a moment unless someone beats me to it.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...