# Dashboard Variables with Cloudwatch Insight Queries

**URL:** <https://community.grafana.com/t/dashboard-variables-with-cloudwatch-insight-queries/52609>\
**Category:** Configuration\
**Tags:** cloudwatch\
**Created:** [August 30, 2021, 4:22pm UTC](https://community.grafana.com/t/dashboard-variables-with-cloudwatch-insight-queries/52609 "2021-08-30T16:22:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![merorafael](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/merorafael/32/18381_2.png) [@merorafael](https://community.grafana.com/u/merorafael)\
**Post date:** [August 30, 2021, 4:22pm UTC](https://community.grafana.com/t/dashboard-variables-with-cloudwatch-insight-queries/52609/1 "2021-08-30T16:22:48Z")

</div>

I’m trying to add a new variable on a dashboard using a CloudWatch Insight query, but I think that Grafana dashboard variables don’t recognize log insight queries. I’m right?

My expected result is to use log insight queries to make dashboard variables results.

On “Variables” in my dashboard settings, I’m putting the info below.

**On “General” section**

**Type:** Query

**On “Query options” section**

**Data source:** My CloudWatch data source  
**Refresh:** On dashboard load  
**Query:**

```auto
fields @message
| filter @message like 'company_name'
| parse @message /\\"company_id\\":\\"(?<company_id>.*?)\\"/
| parse @message /\\"company_name\\": \\"(?<company_name>.*?)\\"/
| stats count(*) by company_id, company_name
| display company_id, company_name

```

Expected result: list a dropdown with companies ID and name.

Thanks for any help! 😃

---

<div class="post-metadata">

**Author:** ![codesenju](https://avatars.discourse-cdn.com/v4/letter/c/e9c0ed/32.png) [@codesenju](https://community.grafana.com/u/codesenju)\
**Post date:** [August 25, 2023, 1:09pm UTC](https://community.grafana.com/t/dashboard-variables-with-cloudwatch-insight-queries/52609/2 "2023-08-25T13:09:47Z")

</div>

I had the same question have you figured it out?

---

<div class="post-metadata">

**Author:** ![rahulchavan](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@rahulchavan](https://community.grafana.com/u/rahulchavan)\
**Post date:** [July 29, 2024, 12:36pm UTC](https://community.grafana.com/t/dashboard-variables-with-cloudwatch-insight-queries/52609/3 "2024-07-29T12:36:30Z")

</div>

@merorafael @codesenju Have you found the solution for above problem?

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [July 29, 2024, 3:07pm UTC](https://community.grafana.com/t/dashboard-variables-with-cloudwatch-insight-queries/52609/4 "2024-07-29T15:07:02Z")

</div>

what is the query you arw using to configure the variable
