# Create a variable on Dashboard from log metric data

**URL:** <https://community.dynatrace.com/t/create-a-variable-on-dashboard-from-log-metric-data/52223>\
**Category:** Dashboarding\
**Tags:** dashboards\
**Created:** [June 24, 2025, 12:33pm UTC](https://community.dynatrace.com/t/create-a-variable-on-dashboard-from-log-metric-data/52223 "2025-06-24T12:33:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![avdveen](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@avdveen](https://community.dynatrace.com/u/avdveen)\
**Post date:** [June 24, 2025, 12:33pm UTC](https://community.dynatrace.com/t/create-a-variable-on-dashboard-from-log-metric-data/52223/1 "2025-06-24T12:33:23Z")

</div>

I have created a log metric for IIS logs, which provides the _http.target_ (URI) as a dimension and I want to use that as a variable so that users can select from (split by) the different URIs to see the URL queries relating to these URIs.

I’m struggling with the DQL for the variable though, as I end up with non-URI related options in my results - any suggestions what the DQL would look like to split / filter by URI for a metric _log.examplemetricname_?

---

<div class="post-metadata">

**Author:** ![marco\_irmer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/marco_irmer/32/3038_2.png) [@marco\_irmer](https://community.dynatrace.com/u/marco_irmer)\
**Post date:** [June 24, 2025, 2:06pm UTC](https://community.dynatrace.com/t/create-a-variable-on-dashboard-from-log-metric-data/52223/2 "2025-06-24T14:06:44Z")

</div>

The simplest way to accomplish this will be to utilize the [fields](https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-query-language/commands/selection-and-modification-commands#fields) command to take the timeseries data down to just the field(s) of interest.

DQL:

```javascript
timeseries sum(log.examplemetricname), by:{http.target}
| fields http.target

```

---

<div class="post-metadata">

**Author:** ![avdveen](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@avdveen](https://community.dynatrace.com/u/avdveen)\
**Post date:** [June 24, 2025, 2:34pm UTC](https://community.dynatrace.com/t/create-a-variable-on-dashboard-from-log-metric-data/52223/3 "2025-06-24T14:34:53Z")

</div>

Thank you&nbsp;[@marco\_irmer](https://community.dynatrace.com/user/19769), this seems so easy and simple now that I know the solution, hahaha!&nbsp;  
I clearly try to overcomplicate DQL 😉
