# DQL query to have specific AWS tag available as value

**URL:** <https://community.dynatrace.com/t/dql-query-to-have-specific-aws-tag-available-as-value/45922>\
**Category:** DQL\
**Tags:** dql, aws\
**Created:** [June 5, 2024, 9:05am UTC](https://community.dynatrace.com/t/dql-query-to-have-specific-aws-tag-available-as-value/45922 "2024-06-05T09:05:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aled](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@aled](https://community.dynatrace.com/u/aled)\
**Post date:** [June 5, 2024, 9:05am UTC](https://community.dynatrace.com/t/dql-query-to-have-specific-aws-tag-available-as-value/45922/1 "2024-06-05T09:05:35Z")

</div>

In the old dashboard, I have a dynamic filter set on a specific AWS tag “Tag key: Custom device [AWS]environment”

I’m trying to replicate this behaviour in the new dashboards, using variables  
However, using DQL I’m failing to write a query to extract the possible values for a specific tag

Here’s where I am so far :

```python
fetch `dt.entity.cloud‌‌sqs`
| fields tags

```

(_not very far along as you can see_)

My goal is to have a variable listing all existing values for my “environment” tag

---

<div class="post-metadata">

**Author:** ![mark\_bley](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mark_bley/32/20954_2.png) [@mark\_bley](https://community.dynatrace.com/u/mark_bley)\
**Post date:** [June 6, 2024, 3:45pm UTC](https://community.dynatrace.com/t/dql-query-to-have-specific-aws-tag-available-as-value/45922/2 "2024-06-06T15:45:55Z")

</div>

maybe this can help

```markup
fetch dt.entity.cloud‌‌sqs
| fields tags
| expand tags
| filter contains(tags, "[AWS]environment")
| parse tags, """LD ':' LD:value"""
| fieldsRemove tags
| sort value asc
| summarize environments = collectDistinct(value)

```

---

<div class="post-metadata">

**Author:** ![aled](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@aled](https://community.dynatrace.com/u/aled)\
**Post date:** [June 7, 2024, 9:04am UTC](https://community.dynatrace.com/t/dql-query-to-have-specific-aws-tag-available-as-value/45922/3 "2024-06-07T09:04:46Z")

</div>

Works great! Thanks 🙂
