# Create a Metric from a value other than DQL Matcher

**URL:** <https://community.dynatrace.com/t/create-a-metric-from-a-value-other-than-dql-matcher/46055>\
**Category:** DQL\
**Tags:** dql, dynatrace-managed, logs\
**Created:** [June 11, 2024, 4:45pm UTC](https://community.dynatrace.com/t/create-a-metric-from-a-value-other-than-dql-matcher/46055 "2024-06-11T16:45:58Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [June 11, 2024, 4:45pm UTC](https://community.dynatrace.com/t/create-a-metric-from-a-value-other-than-dql-matcher/46055/1 "2024-06-11T16:45:58Z")

</div>

Hello Community,

I need to create a metric from a value using the countDistinct function and to save that value over time, the DQL query is the following:

```markup
fetch logs
| FILTER matchesValue(k8s.container.name, "onboarding-service") AND matchesPhrase(content, "\"result\":\"ok\",\"step\":\"cvu\"") AND matchesPhrase(content, "triggering next step with state machine")
| summarize countDistinct(client.id), alias: CvuCreadoPorCliente

```

but metric extraction only supports [DQL matcher in logs — Dynatrace Docs](https://docs.dynatrace.com/docs/shortlink/lma-log-processing-matcher)

any other idea to do this?

Thanks

---

<div class="post-metadata">

**Author:** ![\_r\_k](https://avatars.discourse-cdn.com/v4/letter/_/3d9bf3/32.png) [@\_r\_k](https://community.dynatrace.com/u/_r_k)\
**Post date:** [July 15, 2024, 8:37am UTC](https://community.dynatrace.com/t/create-a-metric-from-a-value-other-than-dql-matcher/46055/2 "2024-07-15T08:37:58Z")

</div>

any update please for this or any summarization in log processing (some example etc)?

---

<div class="post-metadata">

**Author:** ![krzysztof\_hoja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/krzysztof_hoja/32/34625_2.png) [@krzysztof\_hoja](https://community.dynatrace.com/u/krzysztof_hoja)\
**Post date:** [July 15, 2024, 7:48pm UTC](https://community.dynatrace.com/t/create-a-metric-from-a-value-other-than-dql-matcher/46055/3 "2024-07-15T19:48:36Z")

</div>

I can imagine some possible solutions (or rather workarounds)…  
What is the cardinality of&nbsp;client.id? How many of them are active in the same moment (e.g. in 1 minute)? What is the desired time resolution for this metric (does it have to be 1 minute or maybe 1h is good enough?)

---

<div class="post-metadata">

**Author:** ![\_r\_k](https://avatars.discourse-cdn.com/v4/letter/_/3d9bf3/32.png) [@\_r\_k](https://community.dynatrace.com/u/_r_k)\
**Post date:** [July 16, 2024, 6:49am UTC](https://community.dynatrace.com/t/create-a-metric-from-a-value-other-than-dql-matcher/46055/4 "2024-07-16T06:49:26Z")

</div>

if you are thinking about recreating timestamps based on interval and timespan it is too crazy to be used for dynamic dashboards

---

<div class="post-metadata">

**Author:** ![krzysztof\_hoja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/krzysztof_hoja/32/34625_2.png) [@krzysztof\_hoja](https://community.dynatrace.com/u/krzysztof_hoja)\
**Post date:** [July 16, 2024, 4:05pm UTC](https://community.dynatrace.com/t/create-a-metric-from-a-value-other-than-dql-matcher/46055/5 "2024-07-16T16:05:08Z")

</div>

Not thinking about it at all…

But answering your question regarding examples for summarization in log processing:

> **[Create log metric](https://docs.dynatrace.com/docs/analyze-explore-automate/logs/lma-use-cases/lma-e2e-create-log-metric)**
>
> Explore the Log Management and Analytics use case for creating a log metric.

or if you use OpenPipeline already:

> **[Parse log lines and extract a metric](https://docs.dynatrace.com/docs/platform/openpipeline/use-cases/tutorial-log-processing-pipeline)**
>
> Configure OpenPipeline processing for log lines.

My question was toward: how we can use supported summarizations (sum or count) to get data with reduced volume enough but still detailed enough to calculate countDistinct

---

<div class="post-metadata">

**Author:** ![ANLTH](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@ANLTH](https://community.dynatrace.com/u/ANLTH)\
**Post date:** [October 16, 2024, 12:50pm UTC](https://community.dynatrace.com/t/create-a-metric-from-a-value-other-than-dql-matcher/46055/6 "2024-10-16T12:50:31Z")

</div>

I have a similar challenge. I would like to create a Metric for “SynchronizationTime” it is the sum of

(ResponseTimestamp - EventTimestamp)/1000

My DQL running directly on the Logs looks like this:

fetch logs  
| filter query.name == “IntegrationLog”  
| fieldsAdd Synctime = (c\_ResponseTimestamp\_\_c-c\_EventTimestamp\_\_c)/1000

---

<div class="post-metadata">

**Author:** ![wellpplava](https://avatars.discourse-cdn.com/v4/letter/w/d26b3c/32.png) [@wellpplava](https://community.dynatrace.com/u/wellpplava)\
**Post date:** [August 7, 2025, 3:25am UTC](https://community.dynatrace.com/t/create-a-metric-from-a-value-other-than-dql-matcher/46055/7 "2025-08-07T03:25:57Z")

</div>

Hi there!

We’re working on a metric to count distinct users per page. We initially tried using UserId and Page.name as dimensions, but ran into issues with high cardinality.

Would you be open to sharing any ideas or suggestions on how we might approach this more efficiently?

---

<div class="post-metadata">

**Author:** ![izabelarokita](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/izabelarokita/32/41812_2.png) [@izabelarokita](https://community.dynatrace.com/u/izabelarokita)\
**Post date:** [December 18, 2025, 2:25pm UTC](https://community.dynatrace.com/t/create-a-metric-from-a-value-other-than-dql-matcher/46055/8 "2025-12-18T14:25:15Z")

</div>

Hey&nbsp;[@DanielS](https://community.dynatrace.com/user/35788)&nbsp;[@ANLTH](https://community.dynatrace.com/user/63301)&nbsp;,  
I just wanted to check in and see if you still need help with this. If so, I’d be happy to look into it for you!&nbsp;:blush:  
Please let me know what works best for you.

---

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [December 18, 2025, 6:03pm UTC](https://community.dynatrace.com/t/create-a-metric-from-a-value-other-than-dql-matcher/46055/9 "2025-12-18T18:03:04Z")

</div>

Hi&nbsp;[@IzabelaRokita](https://community.dynatrace.com/user/67399)&nbsp;I’ve created this [idea](https://community.dynatrace.com/post/233074)
