Dashboards & Visualizations

Condition-Match and set token in Drilldown not working

VeEn
Explorer

Hi All

I wanted to build a dashboard that displays some panels only depending on the selection for the drilldown. My approach was the following, but for some reason the condition match is not generating any tokens.

Thanks in advance for your help!

...  
<row>
    <panel>
        <chart>
            <search>
                <query>index=myindex | timechart count by type</query>
                <earliest>$field1.earliest$</earliest>
                <latest>$field1.latest$</latest>
            </search>
            <drilldown>
            <condition match="$click.name2$ == type_1">
                    <set token="mytoken1">true</set>
                    <unset token="mytoken2"></unset>
                </condition>
            <condition match="$click.name2$ == type_2">
                    <set token="mytoken2">true</set>
                    <unset token="mytoken1"></unset>
                </condition>
            </drilldown>
            <option name="charting.chart">line</option>
            <option name="charting.drilldown">all</option>
            <...>
        </chart>
    </panel>
<row>
    <panel depends="$mytoken1$">
    ...
    </panel>
</row>
<row>
    <panel depends="$mytoken2$">
    ...
    </panel>
</row>
1 Solution

akheraj_splunk
Splunk Employee
Splunk Employee

'click.name2' == &quot;type_2&quot;

I've had mixed results using $ for tokens. Use single quotes instead. You also need encoded quotes for the literal value.

View solution in original post

akheraj_splunk
Splunk Employee
Splunk Employee

'click.name2' == &quot;type_2&quot;

I've had mixed results using $ for tokens. Use single quotes instead. You also need encoded quotes for the literal value.

slapie_splunk
Splunk Employee
Splunk Employee

Note for those that are trying to use 'trellis.name' or 'trellis.value'. It doesn't work at the moment (Splunk 7.0.2).

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...