I would like to display the Name of a drop down option in the label of a panel. The token for the drop down filter is $value$. How would I display the Name, such as MY VALUE 1, MY VALUE 2, etc. as a token? I tried label.$value$ and that did not work for me.
I ended up taking the suggestion I received on the slack channels of using the <change> block and setting a token.
<panel>
<title>Top 25 by $label$</title>
<input type="dropdown" token="split_by" searchWhenChanged="true">
<label>Split by</label>
<change>
<condition value="value1">
<set token="label">MY VALUE 1</set>
</condition>
<condition value="value2">
<set token="label">MY VALUE 2</set>
</condition>
<condition value="value3">
<set token="label">MY VALUE 3</set>
</condition>
</change>
<choice value="value1">MY VALUE 1</choice>
<choice value="value2">MY VALUE 2</choice>
<choice value="value3">MY VALUE 3</choice>
<default>value1</default>
<initialValue>value1</initialValue>
<fieldForLabel>split_by</fieldForLabel>
<fieldForValue>split_by</fieldForValue>
</input>
<chart>
<search>
<query></query>
</search>
</chart>
</panel>
Hi @jason_hotchkiss,
instead using static values, you could use a search like the following:
| makeresults
| eval my_field="MyValue1"
| append [
| makeresults
| eval my_field="MyValue2" ]
| append [
| makeresults
| eval my_field="MyValue3" ]
| sort my_field
| table my_fieldin this way, you can use the field "my_field" as the values in the token.
Ciao,
Giuseppe
I ended up taking the suggestion I received on the slack channels of using the <change> block and setting a token.
<panel>
<title>Top 25 by $label$</title>
<input type="dropdown" token="split_by" searchWhenChanged="true">
<label>Split by</label>
<change>
<condition value="value1">
<set token="label">MY VALUE 1</set>
</condition>
<condition value="value2">
<set token="label">MY VALUE 2</set>
</condition>
<condition value="value3">
<set token="label">MY VALUE 3</set>
</condition>
</change>
<choice value="value1">MY VALUE 1</choice>
<choice value="value2">MY VALUE 2</choice>
<choice value="value3">MY VALUE 3</choice>
<default>value1</default>
<initialValue>value1</initialValue>
<fieldForLabel>split_by</fieldForLabel>
<fieldForValue>split_by</fieldForValue>
</input>
<chart>
<search>
<query></query>
</search>
</chart>
</panel>
Hi @jason_hotchkiss ,
good for you, see next time!
let me know if I can help you more, or, please, accept one answer for the other people of Community.
Ciao and happy splunking
Giuseppe
P.S.: Karma Points are appreciated 😉