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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...