Dashboards & Visualizations

Use token value to set another token by using replace

cedriclac
New Member

Hello,

I try to using the token set up in a checkbox who will create a token like that:
(" F " OR " E " OR " W ")
this token will be used as filter on _raw data
but i want to use the token information to refine the search after a rex where i create a column call errorlvl so i want to convert the value of token by using a serie of replace to something like this :
(errorlvl="F" OR errorlvl="E" OR errorlvl="W")

I already know the replace the sequence to use but I have a issue to create in simple xml. Could you help me ?
Thanks

0 Karma

renjith_nair
Legend

@cedriclac ,

You dont need to replace token. You can directly set it at the input level

  <fieldset submitButton="false">
    <input type="checkbox" token="tokErrorLevel" searchWhenChanged="true">
      <label>Error Level</label>
      <choice value="F">F</choice>
      <choice value="E">E</choice>
      <choice value="W">W</choice>
      <valuePrefix>errorlvl="</valuePrefix>
      <valueSuffix>"</valueSuffix>
      <delimiter> OR </delimiter>
      <default>F</default>
    </input>
  </fieldset>

Now you could use the token $tokErrorLevel$ in your search which will add values based on the input selection

Dummy dashboard to try

<form>
  <label>CheckBox</label>
  <fieldset submitButton="false">
    <input type="checkbox" token="tokErrorLevel" searchWhenChanged="true">
      <label>Error Level</label>
      <choice value="F">F</choice>
      <choice value="E">E</choice>
      <choice value="W">W</choice>
      <valuePrefix>errorlvl="</valuePrefix>
      <valueSuffix>"</valueSuffix>
      <delimiter> OR </delimiter>
      <default>F</default>
    </input>
  </fieldset>
  <row>
    <panel>
      <html>
    <h1>
      $tokErrorLevel$
    </h1>
  </html>
    </panel>
  </row>
</form>
---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...