Dashboards & Visualizations

radio button/Dropdown t choose between two types of hosts group

sarnagar
Contributor

I have a dashboard for showing the status of hosts.

I want the dashboard to populate when I choose the hosts via drop down/ radiobutton.

The two hosts groups are something like this.

  1. host=ab* OR host=cd*
  2. host=xy* OR host=un*

My dashboard panels have a search like below:

index = abc hosts=ab* OR host =bc* source =svd.log....

Although I can create a dropdown for these host types I dont think i can replace the highlighted value in the query...

Can someone suggest me how to achieve this>?

Tags (2)
0 Karma
1 Solution

kamlesh_vaghela
SplunkTrust
SplunkTrust

Hi
Can you please try below XML?

<form>
  <label>Multiple Value Dropdown</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="Sourcetype">
      <label>Source Type</label>
      <choice value="scheduler,splunkd">A</choice>
      <choice value="splunk_web_service,splunk_web_access">B</choice>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <title>$Sourcetype$</title>
        <search>
          <query>index=_internal [| makeresults | eval sourcetype="$Sourcetype$" | makemv delim="," sourcetype | mvexpand sourcetype  | format] | stats count by sourcetype</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">20</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">none</option>
        <option name="percentagesRow">false</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
      </table>
    </panel>
  </row>
</form>

Happy Splunking

View solution in original post

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

Hi
Can you please try below XML?

<form>
  <label>Multiple Value Dropdown</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="Sourcetype">
      <label>Source Type</label>
      <choice value="scheduler,splunkd">A</choice>
      <choice value="splunk_web_service,splunk_web_access">B</choice>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <title>$Sourcetype$</title>
        <search>
          <query>index=_internal [| makeresults | eval sourcetype="$Sourcetype$" | makemv delim="," sourcetype | mvexpand sourcetype  | format] | stats count by sourcetype</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">20</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">none</option>
        <option name="percentagesRow">false</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
      </table>
    </panel>
  </row>
</form>

Happy Splunking

0 Karma

sarnagar
Contributor

Thnakyou @ kamlesh_vaghela , that helped.

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...