Splunk Search

Auto-run form Question

Ant1D
Motivator

Hey,

I am trying to produce a form that does not require the use of a search button in order to execute a search and produce a results table. Any ideas of how I can go about achieving this?

Here is a snippet of code from my form: (brackets removed)

fieldset autoRun="true" submitButton="false"

  input type="time" 

    default Last 24 hours /default

  /input

/fieldset

At present, when I first load the page, the search is automatically executed and results are shown for the last 24 hours. From this point, I cannot run anymore searches unless I hit F5 because the search button has been turned off. I want this button to remain disabled but now when I choose a different time range from the dropdown list (i.e. not 24 hours) the new search should run automatically like it would in the Search App that comes default with Splunk.

Any help will be greatly appreciated. Thanks.

Tags (2)
0 Karma
1 Solution

gkanapathy
Splunk Employee
Splunk Employee

Just add the attribute searchWhenChanged="true" to your time picker input:

<fieldset autoRun="true" submitButton="false">
  <input type="time" searchWhenChanged="true">
    <default>Last 24 hours</default>
  </input>
</fieldset>

View solution in original post

Ant1D
Motivator

Thanks for the info gkanapathy

0 Karma

gkanapathy
Splunk Employee
Splunk Employee

Just add the attribute searchWhenChanged="true" to your time picker input:

<fieldset autoRun="true" submitButton="false">
  <input type="time" searchWhenChanged="true">
    <default>Last 24 hours</default>
  </input>
</fieldset>

gkanapathy
Splunk Employee
Splunk Employee

You can leave the XML in and readable as XML if you use the "code" button in the HTML editor box, or use <pre><code>...</code></pre> tags, or enclose in ` (backticks) before and after.

0 Karma

Ant1D
Motivator

Would I have to look into using the TimeRangePicker module? If so, how?

0 Karma
Get Updates on the Splunk Community!

Unlock Database Monitoring with Splunk Observability Cloud

  In today’s fast-paced digital landscape, even minor database slowdowns can disrupt user experiences and ...

Purpose in Action: How Splunk Is Helping Power an Inclusive Future for All

At Cisco, purpose isn’t a tagline—it’s a commitment. Cisco’s FY25 Purpose Report outlines how the company is ...

[Upcoming Webinar] Demo Day: Transforming IT Operations with Splunk

Join us for a live Demo Day at the Cisco Store on January 21st 10:00am - 11:00am PST In the fast-paced world ...