First, a quick look at my existing code:
<form>
<label>Alert Status</label>
<fieldset submitButton="false" autoRun="true">
<input type="dropdown" token="errorcode_tok" searchWhenChanged="true">
<label>KPI Selector</label>
<default>%BGP-5-ADJCHANGE:</default>
<choice value="%BGP-5-ADJCHANGE:">%BGP-5-ADJCHANGE:</choice>
<choice value="%BGP_SESSION-5-ADJCHANGE:">%BGP_SESSION-5-ADJCHANGE:</choice>
<choice value="%BGP-5-FLAP:">%BGP-5-FLAP:</choice>
<choice value="%OSPF-5-ADJCHANGE:">%OSPF-5-ADJCHANGE: </choice>
<choice value="%OSPF-5-ADJCHG:">%OSPF-5-ADJCHG:</choice>
<choice value="%PM-4-ERR_DISABLE:">%PM-4-ERR_DISABLE:</choice>
<choice value="%PM-SP-4-ERR_DISABLE:">%PM-SP-4-ERR_DISABLE:</choice>
<choice value="%SPANTREE-2-ROOTGUARD_BLOCK:">%SPANTREE-2-ROOTGUARD_BLOCK:</choice>
<choice value="%C4K_IOSMODPORTMAN-4-POWERSUPPLYBAD:">%C4K_IOSMODPORTMAN-4-POWERSUPPLYBAD::</choice>
<choice value="%C6K_POWER-SP-1-PD_HW_FAULTY:">%C6K_POWER-SP-1-PD_HW_FAULTY:</choice>
</input>
<input type="time" token="TimeRangePkr" searchWhenChanged="true">
<label>Time Range</label>
<default>
<earliest>-8h</earliest>
<latest>now</latest>
</default>
</input>
</fieldset>
<row>
<panel>
<title>Total Active BGP Events</title>
<viz type="horseshoe_meter_app.horseshoe_meter">
<search>
<query>[search errorcode=$errorcode_tok$ dv_severity NOT "Clear" state=Processed | fields dv_number ] NOT [search errorcode=$errorcode_tok$ dv_severity="Clear" state=Closed | fields dv_number ] | dedup dv_number | stats count(eval(dv_node)) as TOTAL</query>
<earliest>rt</earliest>
<latest>rt</latest>
<sampleRatio>1</sampleRatio>
</search>
Pretty straight forward, right? So why when I do this:
<title>$errorcode_tok$</title>
The title displays $errorcode_tok$ .... literally. Am I missing something on why it doesn't seem to be replacing the reference to the dropdown selection? Thanks in advance.
@kiddsupreme, following works fine for me. Are you trying something else?
<form>
<label>Token in Title</label>
<fieldset submitButton="false" autoRun="true">
<input type="dropdown" token="errorcode_tok" searchWhenChanged="true">
<label>KPI Selector</label>
<default>%BGP-5-ADJCHANGE:</default>
<choice value="%BGP-5-ADJCHANGE:">%BGP-5-ADJCHANGE:</choice>
<choice value="%BGP_SESSION-5-ADJCHANGE:">%BGP_SESSION-5-ADJCHANGE:</choice>
<choice value="%BGP-5-FLAP:">%BGP-5-FLAP:</choice>
<choice value="%OSPF-5-ADJCHANGE:">%OSPF-5-ADJCHANGE: </choice>
<choice value="%OSPF-5-ADJCHG:">%OSPF-5-ADJCHG:</choice>
<choice value="%PM-4-ERR_DISABLE:">%PM-4-ERR_DISABLE:</choice>
<choice value="%PM-SP-4-ERR_DISABLE:">%PM-SP-4-ERR_DISABLE:</choice>
<choice value="%SPANTREE-2-ROOTGUARD_BLOCK:">%SPANTREE-2-ROOTGUARD_BLOCK:</choice>
<choice value="%C4K_IOSMODPORTMAN-4-POWERSUPPLYBAD:">%C4K_IOSMODPORTMAN-4-POWERSUPPLYBAD::</choice>
<choice value="%C6K_POWER-SP-1-PD_HW_FAULTY:">%C6K_POWER-SP-1-PD_HW_FAULTY:</choice>
</input>
<input type="time" token="TimeRangePkr" searchWhenChanged="true">
<label>Time Range</label>
<default>
<earliest>-8h</earliest>
<latest>now</latest>
</default>
</input>
</fieldset>
<row>
<panel>
<title>$errorcode_tok$</title>
<html></html>
</panel>
</row>
</form>
@kiddsupreme, following works fine for me. Are you trying something else?
<form>
<label>Token in Title</label>
<fieldset submitButton="false" autoRun="true">
<input type="dropdown" token="errorcode_tok" searchWhenChanged="true">
<label>KPI Selector</label>
<default>%BGP-5-ADJCHANGE:</default>
<choice value="%BGP-5-ADJCHANGE:">%BGP-5-ADJCHANGE:</choice>
<choice value="%BGP_SESSION-5-ADJCHANGE:">%BGP_SESSION-5-ADJCHANGE:</choice>
<choice value="%BGP-5-FLAP:">%BGP-5-FLAP:</choice>
<choice value="%OSPF-5-ADJCHANGE:">%OSPF-5-ADJCHANGE: </choice>
<choice value="%OSPF-5-ADJCHG:">%OSPF-5-ADJCHG:</choice>
<choice value="%PM-4-ERR_DISABLE:">%PM-4-ERR_DISABLE:</choice>
<choice value="%PM-SP-4-ERR_DISABLE:">%PM-SP-4-ERR_DISABLE:</choice>
<choice value="%SPANTREE-2-ROOTGUARD_BLOCK:">%SPANTREE-2-ROOTGUARD_BLOCK:</choice>
<choice value="%C4K_IOSMODPORTMAN-4-POWERSUPPLYBAD:">%C4K_IOSMODPORTMAN-4-POWERSUPPLYBAD::</choice>
<choice value="%C6K_POWER-SP-1-PD_HW_FAULTY:">%C6K_POWER-SP-1-PD_HW_FAULTY:</choice>
</input>
<input type="time" token="TimeRangePkr" searchWhenChanged="true">
<label>Time Range</label>
<default>
<earliest>-8h</earliest>
<latest>now</latest>
</default>
</input>
</fieldset>
<row>
<panel>
<title>$errorcode_tok$</title>
<html></html>
</panel>
</row>
</form>
You have got to be kidding me. So when I was doing the editing, I would switch back and forth between UI and Source. When I would look, it would show the literal variable name. But when I clicked Save, all of the sudden it was showing properly. My apologies folks, I should have taken... one...more...step
You have just save me a lot of time trying to figure out what is wrong, simple save. Thanks
@kiddsupreme Your comment needs to be in bold. Had exactly same problem, saving solved the issue. Thanks!
@kiddsupreme, when you are in UI Edit mode, tokens will not be set. Now you know 🙂
One question, are you getting right value in search query errorcode=$errorcode_tok$
after selecting for dropdown?