All Apps and Add-ons

How do I default 'select all' in a db connect query with a multi-select on a dashboard?

thomasneat
Engager

The dashboard panel works great except that due to the multi-select and the options in the query the initial page is waiting for input from the multi-select box and I cannot get the wildcard * to select all.

I would like to make the multi-select default 'all' but cannot get it to work. 'No results found.'

Edit: Posting code works a little different here than other sites.

  <label>Date Range</label>
  <default>
    <earliest>-2d@d</earliest>
    <latest>now</latest>
  </default>
  <change>
    <eval token="form.et">strftime(relative_time(now(),'earliest'), "%F %T")</eval>
    <eval token="form.lt">strftime(relative_time(now(),'latest'), "%F %T")</eval>
  </change>
</input>
<input type="multiselect" token="code" searchWhenChanged="true">
  <label>Code</label>
  <choice value="">All</choice>
  <choice value="1">1</choice>
  <choice value="2">2</choice>
  <choice value="3">3</choice>
  <delimiter> OR </delimiter>
  <valuePrefix>Code = '</valuePrefix>
  <valueSuffix>'</valueSuffix>
</input>

<query>| dbxquery query="SELECT Date,ID,City,Amount,Code FROM \"Safe\".\"dbo\".\"Data\" WHERE ($code$) AND (Date &gt;= '$form.et$' AND Date &lt;= '$form.lt$')" connection="database" | sort num(City)</query>
0 Karma

thomasneat
Engager

I wish I was. I've tried it with the wildcard * and with a carrot ^ I gathered from other responses. Nothing supplies any results. If I leave out the multiselect altogether it gives me everything within the date ranges.

0 Karma

nickhills
Ultra Champion
  <label>Date Range</label>
   <default>
     <earliest>-2d@d</earliest>
     <latest>now</latest>
   </default>
   <change>
     <eval token="form.et">strftime(relative_time(now(),'earliest'), "%F %T")</eval>
     <eval token="form.lt">strftime(relative_time(now(),'latest'), "%F %T")</eval>
   </change>
 </input>
 <input type="multiselect" token="code" searchWhenChanged="true">
   <label>Code</label>
   <choice value="*">All</choice>
   <choice value="1">1</choice>
   <choice value="2">2</choice>
   <choice value="3">3</choice>
   <delimiter> OR </delimiter>
   <valuePrefix>Code = '</valuePrefix>
   <valueSuffix>'</valueSuffix>
 </input>
 <query>| dbxquery query="SELECT Date,ID,City,Amount,Code FROM \"Safe\".\"dbo\".\"Data\" WHERE ($code$) AND (Date >= '$form.et$' AND Date <= '$form.lt$')" connection="database" | sort num(City)</query>

Are you just missing * from the ALL option?

If my comment helps, please give it a thumbs up!
0 Karma
*NEW* Splunk Love Promo!
Snag a $25 Visa Gift Card for Giving Your Review!

It's another Splunk Love Special! For a limited time, you can review one of our select Splunk products through Gartner Peer Insights and receive a $25 Visa gift card!

Review:





Or Learn More in Our Blog >>