Dashboards & Visualizations

How to use choice values with token?

felipesewaybric
Contributor
  <input type="multiselect" token="reason_token" searchWhenChanged="true">
    <label>Filtro de Causas</label>
    <search>
      <query>| dbquery DB01 "select 
      idt_deduction as \"reason\",
      des_deduction as \"desc\"
      from deduction
      where idt_deduction_group='$group_token$'"
      | eval teste = $group_token$
      | stats values(reason) as reason by desc 
      | eval Reason = reason + " - " + desc</query>
    </search>
    <fieldForLabel>Reason</fieldForLabel>
    <fieldForValue>reason</fieldForValue>
    <delimiter> , </delimiter>
    <choice value="select 
      idt_deduction_reason
      from deduction_reason 
      where idt_deduction_reason_group='$group_token$'">All
    </choice>
  </input>
Tags (3)
0 Karma

FritzWittwer_ol
Contributor

I usual use something in the form of..

<input type="multiselect" token="reason_token" searchWhenChanged="true">
  <label>Filtro de Causas</label>
  <populatingSearch fieldForLabel="Reason" fieldForValue="reason">
    | dbquery DB01 .....
  </populatingSearch>
  <delimiter> , </delimiter>
</input>
0 Karma

woodcock
Esteemed Legend

Your $group_token$ is not being set anywhere so it can never work. How are you planning to set it?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...