Splunk Search

How do I submit a radio button search with a submit button without changing the Time Picker?

rmccarthy_splun
Splunk Employee
Splunk Employee

I am using simple XML and I need to submit a search I have defined in a radio button. I need to do this with a Submit button without changing the Time Picker. Currently, I can make the radio button selection and change the Time Picker, and THEN the Submit button and get a result. What I NEED to do is re-initiate the search without changing the time picker.

How can I accomplish this?

The following is a snip of the XML code:

<form>
  <label>AppName</label>
  <description>WhatItDoes</description>
  <fieldset submitButton="true">
    <input type="radio" token="field1" searchWhenChanged="false">
      <label>Anomaly Type</label>
      <choice value="foo1">Foo1</choice>
      <choice value="foo2">Foo2</choice>
      <choice value="">None</choice>
      <search>
        <query>| script $field1$</query>
        <earliest>0</earliest>
      </search>
      <fieldForLabel>test</fieldForLabel>
      <fieldForValue>test</fieldForValue>
    </input>
    <input type="time" token="field2">
      <label></label>
      <default>
        <earliest></earliest>
        <latest></latest>
      </default>
    </input>
  </fieldset>
Tags (1)
0 Karma

rafamss
Contributor

Hi,

I did the Dashboard below and in my case it is worked fine. For your question, only marking the searchWhenChanged parameter for false it is should be run. By the way, I put the text input instead radio button and put the searchWhenChanged = true for this.

<fieldset submitButton="true">
<input type="time" token="datetime" searchWhenChanged="false">
<input type="text" token="channel" searchWhenChanged="true">

Governance

<input type="time" token="datetime" searchWhenChanged="false">
  <label>Date-Time</label>
  <default>
    <earliest>-5m</earliest>
    <latest>now</latest>
  </default>
</input>
<input type="text" token="channel" searchWhenChanged="true">
  <label>channel</label>
  <search>
    <query>my_query</query>
    <earliest>-15m</earliest>
    <latest>now</latest>
  </search>
  <fieldForLabel>channel</fieldForLabel>
  <fieldForValue>channel</fieldForValue>
  <default>*</default>
</input>


<panel>
  <chart>
    <search>
      <query>index=* $channel$ | stats count by application | head 10</query>
      <earliest>$datetime.earliest$</earliest>
      <latest>$datetime.latest$</latest>
    </search>
    <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
    <option name="charting.axisLabelsX.majorLabelStyle.rotation">0</option>
    <option name="charting.axisTitleX.visibility">visible</option>
    <option name="charting.axisTitleY.visibility">visible</option>
    <option name="charting.axisTitleY2.visibility">visible</option>
    <option name="charting.axisX.scale">linear</option>
    <option name="charting.axisY.scale">linear</option>
    <option name="charting.axisY2.enabled">0</option>
    <option name="charting.axisY2.scale">inherit</option>
    <option name="charting.chart">pie</option>
    <option name="charting.chart.bubbleMaximumSize">50</option>
    <option name="charting.chart.bubbleMinimumSize">10</option>
    <option name="charting.chart.bubbleSizeBy">area</option>
    <option name="charting.chart.nullValueMode">gaps</option>
    <option name="charting.chart.showDataLabels">none</option>
    <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
    <option name="charting.chart.stackMode">default</option>
    <option name="charting.chart.style">shiny</option>
    <option name="charting.drilldown">all</option>
    <option name="charting.layout.splitSeries">0</option>
    <option name="charting.layout.splitSeries.allowIndependentYRanges">0</option>
    <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
    <option name="charting.legend.placement">right</option>
    <option name="wrap">true</option>
    <option name="rowNumbers">false</option>
    <option name="dataOverlayMode">none</option>
    <option name="count">10</option>
  </chart>
</panel>
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Vibe-coding, AI, and Splunkcraft: Highlights from the .conf26 Builder Bar

If you stopped by the Builder Bar at .conf26, thank you! This year, we brought ...

Thanks for the Memories: .conf26 Took Learning to New Heights

Thank you, Splunk Community, for making .conf26 in Denver one for the books. From packed Splunk University ...

Best Practices: Splunk auto adjust pipeline queue

When you enable autoAdjustQueue in Splunk, maxSize should be understood as the queue size Splunk starts with ...