I am passing in the following token host_token=$host_token$ in a URL
<link target="_blank">/app/RTPM/blackwidow_testing__technical_dashboard_19_01_2022_v2?host_token=$host_token$&host_token1=$host_token$</link>
However, the Screen that is receiving the token blackwidow_testing__technical_dashboard_19_01_2022_v2 allready has an input for host_token (As the screen can be used on its own, with out someone passing in tokens)
It looks like this. Ideally if the host_token comes in from the URL, i want the value to be set to that. However that does not happy, the URL host_token seems to be ignored and the original dropdown works as if nothing happened.
<input type="dropdown" token="host_token">
<label>HOST</label>
<fieldForLabel>mx.env</fieldForLabel>
<fieldForValue>mx.env</fieldForValue>
<search>
<query>| mstats avg("mx.process.cpu.utilization") as X WHERE "index"="metrics_test" span=10s BY "mx.env"
| dedup mx.env
| table mx.env</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
</input>
As a test I pass in 2 tokens host_token and host_token1 - host_token is set to undefined.
This is the one that i need to get set when it come in from the URL
Any help would be amazing - thanks - Robbie
Hi
In the end, for this, I sent in a TOKEN that falls into what i call a URL trap.
So when the dashboard loads it will go into the correct condition depending on what we want to set the tokens to.
<search>
<query>| makeresults count=1 annotate=false </query>
<done>
<!--Set Tokens if a URL has come to re set some of the tokens to they will be visibale in the screen-->
<condition match="$URL_TRAP$=="SET"">
<set token="form.host_token">$host_token1$</set>
<set token="form.Severity_token">$Severity_token1$</set>
<set token="Severity_token">$Severity_token1$</set>
<set token="form.Service_Name">$Service_Name1$</set>
</condition>
<condition match="match($ERROR_FILTER$,"true")">
<set token="form.Severity_token">"FATAL" "ERROR"</set>
<set token="Severity_token">"FATAL" "ERROR"</set>
</condition>
<condition match="match($EVENT_FILTER$,"EVENT")">
<eval token="form.time_token.earliest">$latest$</eval>
<eval token="form.time_token.latest">$latest$+300</eval>
<set token="form.Severity_token">*</set>
</condition>
<condition>
<set token="Severity_token">*</set>
<set token="Service_Name">*</set>
</condition>
</done>
</search>
Hi
In the end, for this, I sent in a TOKEN that falls into what i call a URL trap.
So when the dashboard loads it will go into the correct condition depending on what we want to set the tokens to.
<search>
<query>| makeresults count=1 annotate=false </query>
<done>
<!--Set Tokens if a URL has come to re set some of the tokens to they will be visibale in the screen-->
<condition match="$URL_TRAP$=="SET"">
<set token="form.host_token">$host_token1$</set>
<set token="form.Severity_token">$Severity_token1$</set>
<set token="Severity_token">$Severity_token1$</set>
<set token="form.Service_Name">$Service_Name1$</set>
</condition>
<condition match="match($ERROR_FILTER$,"true")">
<set token="form.Severity_token">"FATAL" "ERROR"</set>
<set token="Severity_token">"FATAL" "ERROR"</set>
</condition>
<condition match="match($EVENT_FILTER$,"EVENT")">
<eval token="form.time_token.earliest">$latest$</eval>
<eval token="form.time_token.latest">$latest$+300</eval>
<set token="form.Severity_token">*</set>
</condition>
<condition>
<set token="Severity_token">*</set>
<set token="Service_Name">*</set>
</condition>
</done>
</search>
Try using a "form." prefix to the token so that the input of the destination form gets overridden.
<link target="_blank">/app/RTPM/blackwidow_testing__technical_dashboard_19_01_2022_v2?form.host_token=$host_token$&host_token1=$host_token$</link>
You can try using a 3rd host token. the 3rd token uses the value of the url host token if available, otherwise, it uses the host token from the input. use the 3rd host token wherever you need it.
Hi - Thanks for your answer.
In the end, I posed the answer that I used.