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!

Developer Spotlight with Paul Stout

Welcome to our very first developer spotlight release series where we'll feature some awesome Splunk ...

State of Splunk Careers 2024: Maximizing Career Outcomes and the Continued Value of ...

For the past four years, Splunk has partnered with Enterprise Strategy Group to conduct a survey that gauges ...

Data-Driven Success: Splunk & Financial Services

Splunk streamlines the process of extracting insights from large volumes of data. In this fast-paced world, ...