Dashboards & Visualizations

How to create a dynamic panel based on drop-down selection and a text field?

Manish007
New Member

I have 1 drop-down which has 3 options like Order Id, profile Id, email. Now I have 1 text field in which I am giving my input based on drop-down selection. I have different Splunk searches based on my selection. Now I have following questions:

1) How can I do mapping between a text-field and drop-down?
2) How can I generate panel dynamically based on selection of drop-down and text field value ? For e.g. if I select drop-down value email and provide email in text field then panel should fetch relevant details for this selection only.

0 Karma

somesoni2
Revered Legend

See this example (dynamic query)

<form>
  <label>DynamicQuery</label>
  <fieldset submitButton="true" autoRun="true">
    <input type="dropdown" token="unit">
      <label>Select Unit</label>
      <choice value="sourcetype">Sourcetype</choice>
      <choice value="source">Source</choice>
    </input>
    <input type="text" token="value" searchWhenChanged="true">
      <label>Type Value</label>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <title>$unit$ count</title>
        <search>
          <query>index=_internal $unit$="$value$" | stats count</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
        </search>
        <option name="wrap">true</option>
        <option name="rowNumbers">false</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">cell</option>
        <option name="count">10</option>
      </table>
    </panel>
  </row>
</form>
0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...