Dashboards & Visualizations

How can i in Custom Decorations variable?

chengyu
Path Finder

Hi Guys, I create form in my splunk and also create Custom Decorations, and create two choice box time and shcool, i can use time box variable in xml, but school variable i don't understand into form. How should i do into my form? Thanks.

<form stylesheet="devices.css">
  <label>test</label>

  <fieldset submitButton="true" autoRun="true">
    <input type="dropdown" token="school">
      <label>School</label>
      <choice value="*">All School</choice>
      <choice value="A school">A school</choice>
      <choice value="B school">B school</choice>

      <default>*</default>
    </input>
    <input type="time" token="time" searchWhenChanged="true">
      <label>time</label>
      <default>
        <earliest>-15m</earliest>
        <latest>now</latest>
      </default>
    </input>
  </fieldset>

    <search>
    <query>index=* splunk_server=*   | stats  count as value  | rangemap field=value  low=1- 10000 severe=0-0 default=low</query>
    <earliest>$time.earliest$</earliest>
    <latest>$time.latest$</latest>
    <progress>
      <set token="value2">$result.value$</set>
      <set token="range2">$result.range$</set>
    </progress>
  </search>

  <row>
    <panel>
      <html>
        <div class="small"> </div>
 <div class="custom-result-value icon-only $range2$"> $school$ </div>

            </html>

    </panel>
  </row>
Tags (2)
0 Karma

niketn
Legend

You can use $school$ to populate the value of choice Dropdown in you search queries.

Infact Dropdown gives you access to both Name and Value provided you are storing two different values.
Refer to Splunk 6.x Dashabord Examples app for details and also following documentation: http://docs.splunk.com/Documentation/Splunk/latest/Viz/Buildandeditforms

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...