Dashboards & Visualizations

How can I use tokens inside eventtypes in an html dashboard?

kartik13
Communicator

Hi,

I am forming a search which selects the environment from the drop-down menu and the value from it gets selected inside the eventtype . How can i do it in an html dashboard?

0 Karma

stephane_cyrill
Builder

Hi,

If I understand you well you have a form with dropdown and you want the value of the dropdown to filter

the query given by the eventtype. if I'm not wrong, What you have to do is:

1- create your dropdown populated by a search that gives you the appropriat values you will use to filter the eventtype

2- place the token in the query as you desire.

THE FOLLOWING IS AN EXAMPLE OF FORM LIKE THAT(i'm using splunk 6.2):

the eventtype is about source and i filter it with sources values from the dropdown.

<form>
  <label>Dashb_test</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="source">
      <choice value="*">all</choice>
      <search>
        <query>index=* source=*  |stats c by  source</query>
      </search>
      <fieldForLabel>source</fieldForLabel>
      <fieldForValue>source</fieldForValue>
    </input>
  </fieldset>
  <row>
    <panel>
      <event>
        <search>
          <query>index=* eventtype=source_eventtype|search source=$source$</query>
          <earliest></earliest>
          <latest></latest>
        </search>
      </event>
    </panel>
  </row>
</form>
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...