Dashboards & Visualizations

How to pass a token with multiple values to multiselect input as initial values

philippbloch
Loves-to-Learn Lots

Hello there,

I'm trying to fill a multiselect input with a initial value based on a token. The token is based on a lookup search.

<form>
  <label>dashboard</label>
  <search>
    <query>
           | inputlookup lookup.csv
    </query>
    <earliest>-24h</earliest>
    <latest>now</latest>
    <done>
      <set token="tok_lookup">$result.column$</set>
    </done>
  </search>
  <fieldset submitButton="false">
    <input type="multiselect" token="tok_multiselect" searchWhenChanged="false">
      <label>Multi-Select</label>
      <delimiter>,</delimiter>
      <fieldForLabel>column</fieldForLabel>
      <fieldForValue>column</fieldForValue>
      <search>
        <query>| loadjob savedsearch="admin:app:multiselect_list"</query>
        <earliest>-2h@h</earliest>
        <latest>now</latest>
      </search>
      <initialValue>$tok_lookup$</initialValue>
    </input>
  </fieldset>

  ...

 </form>

The inputlookup of lookup.csv does return a single column with multiple rows if run in a seperate search:

column
-----------
value1
value2
value3

value1, value2, value3 should show up as a seperate initial values in the multiselect input. Currently the values do not show up at all. - If I use the token as default, only the first value "value1" is populated to the multiselect field.

Thanks a lot for your help.
Regards,
Philipp

Labels (2)
0 Karma

philippbloch
Loves-to-Learn Lots

I got some new additional information spare: I modified the lookup with mvcombine to have the result in a single row comma-separated:

| mvcombine delim="," field | nomv field

I checked the format how the initial value of the multiselect input needs to be defined:

<initialValue>value1,value2,value3</initialValue>

But passing the token in this style doesn't work as well. The initial value shows up as one huge value. Not in separate values.

If I define the initial value manually by putting in the values by hand (for example in the order of value1,value2,value3) it works perfectly.

Any ideas? Anyone?

0 Karma

vnravikumar
Champion

Hi

$result.<fieldname>$ -   The token accesses the value from the first row of returned results.

You can check here:
https://docs.splunk.com/Documentation/Splunk/8.0.3/Viz/EventHandlerReference

0 Karma

philippbloch
Loves-to-Learn Lots

Hi! Thanks for the response. 🙂

I got it. Any idea if it will work if I combine the results to a single row?

For example: value1,value2,value3

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...