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>
Happy Splunking!
0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...