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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...