Splunk Enterprise Security

How do you pass the same token for two panels with one drop-down input?

bhaskarasplunk
Explorer

I want to pass a token from one panel to another panel. I mean, if I give one input in the drop down, it has to update both the panels in the same dashboard. Basically, the same token is used by two panels but I don't want give the same input twice by two drop-downs. My token is the same for the two panels ( Token1-Panel 1 and Token1-panel 2).

Can you please provide me with some example code that I can update in my panels?

0 Karma
1 Solution

renjith_nair
Legend

@bhaskarasplunk ,

Just reuse the token in the panels.

Whenever the drop down is changed, same value is displayed in both panels.

<form>
  <label>SIngle Token</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="tok">
      <label>Value</label>
      <choice value="A">A</choice>
      <choice value="B">B</choice>
      <default>A</default>
    </input>
  </fieldset>
  <row>
    <panel>
      <title>PANEL 1</title>
      <single>
        <search>
          <query>|makeresults| eval data="$tok$"|fields data</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
        <option name="showTrendIndicator">0</option>
      </single>
    </panel>
    <panel>
      <title>PANEL 2</title>
      <single>
        <search>
          <query>|makeresults| eval data="$tok$"|fields data</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
        <option name="showTrendIndicator">0</option>
      </single>
    </panel>
  </row>
</form>
---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

renjith_nair
Legend

@bhaskarasplunk ,

Just reuse the token in the panels.

Whenever the drop down is changed, same value is displayed in both panels.

<form>
  <label>SIngle Token</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="tok">
      <label>Value</label>
      <choice value="A">A</choice>
      <choice value="B">B</choice>
      <default>A</default>
    </input>
  </fieldset>
  <row>
    <panel>
      <title>PANEL 1</title>
      <single>
        <search>
          <query>|makeresults| eval data="$tok$"|fields data</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
        <option name="showTrendIndicator">0</option>
      </single>
    </panel>
    <panel>
      <title>PANEL 2</title>
      <single>
        <search>
          <query>|makeresults| eval data="$tok$"|fields data</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
        <option name="showTrendIndicator">0</option>
      </single>
    </panel>
  </row>
</form>
---
What goes around comes around. If it helps, hit it with Karma 🙂

bhaskarasplunk
Explorer

Thank you.

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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