Dashboards & Visualizations

Custom logic for dashboard - checkbox

New Member

I followed http://docs.splunk.com/Documentation/Splunk/6.5.0/Viz/tokens and successfully created some custom logic for a dropdown input.

Problem comes when I tried to use a checkbox instead of a dropdown.

I tried to create a custom logic on my dashboard, however, the problem is that $value$ does not return all the values that I checked.

<input type="checkbox" token="field1">
        <choice value="1">1</choice>
        <choice value="7">7</choice>
        <choice value="30">30</choice>
            <set token="query">(days=$value$)</set>
        <delimiter> ,</delimiter>

The problem is that $value$ does not return something like "1,7,30", instead, I could only get a single value, which is not enough for my further calculation. Any ways that I can get the full list of checked options? Thanks!

0 Karma

Re: Custom logic for dashboard - checkbox


In this line <set token="query">(days=$value$)</set> try to replace $value$ with $field1$. The checkbox input token is field1 for your code as seen in this line :- <input type="checkbox" token="field1">.

Please see the code below where I was able to extract all the three values in a comma separated text and used it in the title of the panel and also in the text of the text box. Hope it helps.

  <fieldset submitButton="false">
    <input type="checkbox" token="field1">
      <choice value="1">aa</choice>
      <choice value="12">bb</choice>
      <choice value="13">cc</choice>
          <set token="query">(days=$field1$)</set>
    <input type="text" token="field2">
        <title>Panel title =  $field1$</title>
        <option name="wrap">undefined</option>
        <option name="rowNumbers">undefined</option>
        <option name="drilldown">row</option>
        <option name="dataOverlayMode">none</option>
        <option name="count">10</option>
0 Karma