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!

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...