I wanted to concatenate a token with a string inside a query. How should I accomplish this? For example, I have this token, $foo$ (Lets say this equals “foo” for this example) and a string “bar” and I want to combine them together to represent sourcetype=“foobar” inside my query search, how can I do that? I tried using
eval sourcetype=concat($foo$, “bar”)
But it didn’t work (I’m assuming because i tried this expression in the middle of a query,
<query> index=some_dataset eval sourcetype=concat($foo$, “bar”) </query>
Is there a way to do this inside a query?
I wanted to also add that this is for a dashboard