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!

Preparing your Splunk Environment for OpenSSL3

The Splunk platform will transition to OpenSSL version 3 in a future release. Actions are required to prepare ...

Deprecation of Splunk Observability Kubernetes “Classic Navigator” UI starting ...

Access to Splunk Observability Kubernetes “Classic Navigator” UI will no longer be available starting January ...

Now Available: Cisco Talos Threat Intelligence Integrations for Splunk Security Cloud ...

At .conf24, we shared that we were in the process of integrating Cisco Talos threat intelligence into Splunk ...