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.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...