In the definition of my dashboard which I define using SimpeXML I start out by setting a token that relies on other variables. I want to re-evaluate this token when I change one of the input variables in the token.
<init>
<set token="baseQuery">
index=$environment$ logGroup="/aws/lambda/*"
| transaction traceId startswith=$fromEvent$ endswith=$toEvent$
</set>
</init>
That is the base query to which I append extra text to get the full query behind each of my dashboards:
<query>$baseQuery$ | stats </query>
The variables like $fromEvent$ and $toEvent$ are extracted using input elements:
<input type="dropdown" token="fromEvent" searchWhenChanged="true">
<label>fromEvent</label>
<choice value="START">START</choice>
<choice value="FINISH">FINISH</choice>
<default>SHIPMENT_RECEIVED</default>
</input>
I'd like the baseQuery to be re-evaluated when I select a new value in my dropdown.
I have tried to add several child elements to the input element but I cannot make it work.
<change>
<set token="baseQuery"></set>
</change>
<change>
<set token="baseQuery">$baseQuery$</set>
</change><change>
<set token="baseQuery">$baseQuery.value$</set>
</change>
But none of them seem to work.
It does work when I set the query again. This causes duplicate code. In reality the query is a lot longer than what you see here. So it is very verbose:
<change>
<set token="baseQuery">
index=$environment$ logGroup="/aws/lambda/*"
| transaction traceId startswith=$fromEvent$ endswith=$toEvent$
</set>
</change>
Is there any way to update the value of the baseQuery token without setting it again as a whole? It should be updated when I change one of the input values.
... View more