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
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...