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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...