Splunk Search

Is it possible to have one checkbox that can be used to toggle between 2 difference searches on a dashboard panel?

anshushireen
New Member

I need to select two different searches for my table based on the toggle option. Please help

0 Karma

chimell
Motivator

Hi
Look at this search code it might be help

<form>
   <label>TestDynamicPanel</label>
   <fieldset submitButton="false">
     <input type="dropdown" token="show1">
       <label>Dropdown1</label>
       <populatingSearch fieldForLabel="temp" fieldForValue="temp">|gentimes start=-1 | eval temp="ColumnChart" | table temp</populatingSearch>
     </input>
     <input type="dropdown" token="show2">
       <label>Dropdown2</label>
       <populatingSearch fieldForLabel="temp" fieldForValue="temp">|gentimes start=-1 | eval temp="LineChart" | table temp</populatingSearch>
     </input>
     <input type="dropdown" token="show3">
       <label>Dropdown3</label>
       <populatingSearch fieldForLabel="temp" fieldForValue="temp">|gentimes start=-1 | eval temp="Table" | table temp</populatingSearch>
     </input>
   </fieldset>
   <row>
     <panel>
       <chart depends="$show1$">
       <title>Details for $submitted:sourcetype|s$</title>
      <searchString>index=_internal | timechart count</searchString>
         <earliestTime>-15m</earliestTime>
         <latestTime>now</latestTime>
         <option name="charting.chart">column</option>
     </chart>
       <chart depends="$show2$">
       <title>Details for $submitted:sourcetype|s$</title>
      <searchString>index=_internal | timechart count</searchString>
         <earliestTime>-15m</earliestTime>
         <latestTime>now</latestTime>
         <option name="charting.chart">line</option>
     </chart>
       <table depends="$show3$">
         <searchString>index=_internal | timechart count</searchString>
         <earliestTime>-15m</earliestTime>
         <latestTime>now</latestTime>
       </table>
     </panel>
   </row>
 </form>
0 Karma

gyslainlatsa
Motivator
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...