所以我试图根据 Splunk 仪表板中另一个令牌的值隐藏面板。
设panel隐藏所依赖的token值为variableValue。 variableValue 具有不同的 Splunk 值,例如 abc、def 和 *。该输入令牌的配置如下。
</input>
<input type="multiselect" token="variableValue" searchWhenChanged="true">
<label>Variable Value</label>
<choice value="abc">abc</choice>
<choice value="def">def</choice>
<choice value="*">ALL</choice>
<default>*</default>
<valuePrefix>log.request="</valuePrefix>
<valueSuffix>"</valueSuffix>
<delimiter> </delimiter>
</input>
现在,如果variableValue的值不是*,我需要隐藏不同的面板。
为了实现这一点,我为该面板使用了
<panel depends="$panel_show$">
,并在其下放置以下配置:
<progress>
<condition match="$variableValue$!=*">
<set token="panel_show">true</set>
</condition>
<condition>
<unset token="panel_show"></unset>
</condition>
</progress>
但是,这不起作用。有人可以帮我理解我在这里做错了什么吗?
我不确定面板可以这样隐藏自己。当
panelShow
发生变化时,我可以通过设置 variableValue
来使其工作。
<form version="1.1" theme="light" script="simple_xml_examples:showtokens.js">
<fieldset>
<input type="multiselect" token="variableValue" searchWhenChanged="true">
<label>Variable Value</label>
<choice value="abc">abc</choice>
<choice value="def">def</choice>
<choice value="*">ALL</choice>
<default>*</default>
<valuePrefix>log.request="</valuePrefix>
<valueSuffix>"</valueSuffix>
<delimiter> </delimiter>
<change>
<condition match="$form.variableValue$!="*"">
<set token="panel_show">true</set>
</condition>
<condition>
<unset token="panel_show"></unset>
</condition>
</change>
</input>
</fieldset>
<row>
<panel depends="$panel_show$">
<title>Test</title>
<search><query>index=_internal earliest=-60m</query>
<!--<progress>
<condition match="$form.variableValue$!="*"">
<set token="panel_show">true</set>
</condition>
<condition>
<unset token="panel_show"></unset>
</condition>
</progress>-->
</search>
</panel>
</row>
</form>