0

In my LogStream widget I've the following log query

host:"/aws-glue/app/r/jobs/job_name"

enter image description here

the r letter should be variable based on the environment, thus I introduced a template variable $env_tag enter image description here

host:"/aws-glue/app/$env_tag.value/jobs/job_name"

But it doesn't work ! how can we use template variable inside the query ? Thanks

Smaillns
  • 2,540
  • 1
  • 28
  • 40
  • even `host:/aws-glue/app/$env_tag.value/jobs/job_name` doesn't work – Smaillns Oct 26 '22 at 09:40
  • Not sure if this is feasible, I'd put as a query something like `host:("/aws-glue/app/jobs/job_name" OR "/aws-glue/app/r/jobs/job_name" $host` with the template variable being the name of the host. – XYZ123 Oct 26 '22 at 09:46
  • @XYZ123 unfortunately it doesn't work – Smaillns Oct 26 '22 at 10:17
  • It seems that we can't use a variable to filter based on the host, to encouter this, As a quick solution I used to add the env information inside the message thus we can filter only the messages of a specific environment `(host:"/aws-glue/app/r/jobs/job_name" OR host:"/aws-glue/app/x/jobs/job_name") message:($env.value)` – Smaillns Oct 26 '22 at 11:05
  • So I notice I missed a parenthesis in my query `host:("/aws-glue/app/jobs/job_name" OR "/aws-glue/app/r/jobs/job_name") $host` I tested it on my side and it worked. Your template variable should be `host` and not `@host` is that the case? – XYZ123 Oct 26 '22 at 11:48
  • my template variable is called `env_tag` – Smaillns Oct 27 '22 at 13:23

0 Answers0