# DQL

**URL:** https://community.dynatrace.com/c/platform/dql/83.md?page=19

[Latest](https://community.dynatrace.com/latest.md) · [Categories](https://community.dynatrace.com/categories.md) · [Tags](https://community.dynatrace.com/tags.md)

**Page:** 20

---

## [Timeseries - Distinct count regardless of the time interval value](https://community.dynatrace.com/t/timeseries-distinct-count-regardless-of-the-time-interval-value/48512)

<div class="topic-metadata">

**Author:** [@jegron](https://community.dynatrace.com/u/jegron)\
**Replies:** 2\
**Last updated:** [October 25, 2024, 9:32am UTC](https://community.dynatrace.com/t/timeseries-distinct-count-regardless-of-the-time-interval-value/48512 "2024-10-25T09:32:16Z")

</div>

Hi, I’d like to graph a metric that counts distinct values of a dimension over time, regardless of the time interval value. Example : timeseries { sum = sum(mymetrics, default: 0)}, by:{dimension1, dimension2}, inter…

---

## [Difference in time from one log to the next returned from a query](https://community.dynatrace.com/t/difference-in-time-from-one-log-to-the-next-returned-from-a-query/48478)

<div class="topic-metadata">

**Author:** [@GerryIsHere](https://community.dynatrace.com/u/GerryIsHere)\
**Replies:** 2\
**Last updated:** [October 24, 2024, 9:17pm UTC](https://community.dynatrace.com/t/difference-in-time-from-one-log-to-the-next-returned-from-a-query/48478 "2024-10-24T21:17:51Z")

</div>

I’d like to be able to report and act on the time difference between logs returned by a DQL query. I use the DQL to filter down to the logs of interest, but then how do I compare the timestamp from log n+1 against log n? …

---

## [Conditional DQL sort](https://community.dynatrace.com/t/conditional-dql-sort/48500)

<div class="topic-metadata">

**Author:** [@marina\_pollehn](https://community.dynatrace.com/u/marina_pollehn)\
**Replies:** 3\
**Last updated:** [October 24, 2024, 7:32pm UTC](https://community.dynatrace.com/t/conditional-dql-sort/48500 "2024-10-24T19:32:08Z")

</div>

I often struggle with the current if statement options in DQL. I have created a timeseries with a metric which I called memory. The memory variable is based on either the maximum, minimum or average memory, depending on…

---

## [makeTimeseries | DQL](https://community.dynatrace.com/t/maketimeseries-dql/48385)

<div class="topic-metadata">

**Author:** [@RPbiaggio](https://community.dynatrace.com/u/RPbiaggio)\
**Replies:** 1\
**Last updated:** [October 21, 2024, 4:03pm UTC](https://community.dynatrace.com/t/maketimeseries-dql/48385 "2024-10-21T16:03:29Z")

</div>

Guys, can you help me understand how to transform the data I have separated by month into timeseries? I’m trying to use makeTimeseries, but when I do this, the data no longer returns separated by month due to the time pa…

---

## [Grail Aggregation Function Percentiles](https://community.dynatrace.com/t/grail-aggregation-function-percentiles/44152)

<div class="topic-metadata">

**Author:** [@GregOReilly](https://community.dynatrace.com/u/GregOReilly)\
**Replies:** 10\
**Last updated:** [October 21, 2024, 11:56am UTC](https://community.dynatrace.com/t/grail-aggregation-function-percentiles/44152 "2024-10-21T11:56:30Z")

</div>

Hello! I have found that there are no PERCENTILES as aggregation functions in GRAIL. We have min, max, sum, avg, count and countIf. Any plans to add percentile? Some of my customers only work with percentiles and th…

---

## [How to use the parse command when possible empty value between separators](https://community.dynatrace.com/t/how-to-use-the-parse-command-when-possible-empty-value-between-separators/48397)

<div class="topic-metadata">

**Author:** [@agravier](https://community.dynatrace.com/u/agravier)\
**Replies:** 2\
**Last updated:** [October 18, 2024, 7:26am UTC](https://community.dynatrace.com/t/how-to-use-the-parse-command-when-possible-empty-value-between-separators/48397 "2024-10-18T07:26:22Z")

</div>

Hello, I have to extract data from a line of log using a specific format : provider;id;name;bu;domaine;app;amount;env My DQL request below works when there is no empty value on my record : data record(a = “GCP;128773…

---

## [DQL to Show Elapsed Milliseconds Over a Certain Amouny](https://community.dynatrace.com/t/dql-to-show-elapsed-milliseconds-over-a-certain-amouny/48337)

<div class="topic-metadata">

**Author:** [@Gib80](https://community.dynatrace.com/u/Gib80)\
**Replies:** 1\
**Last updated:** [October 15, 2024, 2:24pm UTC](https://community.dynatrace.com/t/dql-to-show-elapsed-milliseconds-over-a-certain-amouny/48337 "2024-10-15T14:24:24Z")

</div>

Hi All, Is it possible to create a summary that would show the elapsed seconds that went over 5 seconds for example? I have a column which shows the elapsed seconds fields. Thanks

---

## [DQL query](https://community.dynatrace.com/t/dql-query/48203)

<div class="topic-metadata">

**Author:** [@Gib80](https://community.dynatrace.com/u/Gib80)\
**Replies:** 2\
**Last updated:** [October 13, 2024, 11:04pm UTC](https://community.dynatrace.com/t/dql-query/48203 "2024-10-13T23:04:23Z")

</div>

Hi All, I have the below dql query for a dashboard and I need to group the average milliseconds by watchlist per 30 seconds. I’m not sure where I am going wrong, any help is appreciated. timeseries aml=avg(log.applica…

---

## [Return Multiple Items from Variables in Dynatrace DQL Dashboards](https://community.dynatrace.com/t/return-multiple-items-from-variables-in-dynatrace-dql-dashboards/48284)

<div class="topic-metadata">

**Author:** [@badgerfifteen](https://community.dynatrace.com/u/badgerfifteen)\
**Replies:** 2\
**Last updated:** [October 12, 2024, 2:44pm UTC](https://community.dynatrace.com/t/return-multiple-items-from-variables-in-dynatrace-dql-dashboards/48284 "2024-10-12T14:44:34Z")

</div>

Summary: This article explains how to configure DQL queries to return multiple items from variables in dashboards. It includes syntax examples and tips for dynamic data visualisation in Dynatrace. Hi, I’m trying to cod…

---

## [How does timeseries work with interval](https://community.dynatrace.com/t/how-does-timeseries-work-with-interval/48219)

<div class="topic-metadata">

**Author:** [@Maheedhar\_T](https://community.dynatrace.com/u/Maheedhar_T)\
**Replies:** 1\
**Last updated:** [October 9, 2024, 10:22am UTC](https://community.dynatrace.com/t/how-does-timeseries-work-with-interval/48219 "2024-10-09T10:22:53Z")

</div>

In DQL while using timeseries and interval together how does it work when a timeseries data has more than 1 value in a minute when we use something like this? timeseries \`metric1\` = avg(log.metric1), interval: 1m the v…

---

## [Extract Text from Content Using REGEX in DQL Queries](https://community.dynatrace.com/t/extract-text-from-content-using-regex-in-dql-queries/48224)

<div class="topic-metadata">

**Author:** [@thanawat](https://community.dynatrace.com/u/thanawat)\
**Replies:** 4\
**Last updated:** [October 9, 2024, 8:16am UTC](https://community.dynatrace.com/t/extract-text-from-content-using-regex-in-dql-queries/48224 "2024-10-09T08:16:11Z")

</div>

I have this message “Exception org.springframework.web.servlet.resource.NoResourceFoundException”. I want to find the latest section of this message which is “NoResourceFoundException”. I prefer to find the text after …

---

## [Querying services related to an entity](https://community.dynatrace.com/t/querying-services-related-to-an-entity/45198)

<div class="topic-metadata">

**Author:** [@soportetr](https://community.dynatrace.com/u/soportetr)\
**Replies:** 4\
**Last updated:** [October 9, 2024, 4:54am UTC](https://community.dynatrace.com/t/querying-services-related-to-an-entity/45198 "2024-10-09T04:54:33Z")

</div>

Hi everyone, A customer has requested a particular functionality: to display in a table the list of services associated with a specific entity (hosts, processes, etc.). I would like to know if it is possible to perform…

---

## [Build workflow to send SMS notification for problems detected after business hours](https://community.dynatrace.com/t/build-workflow-to-send-sms-notification-for-problems-detected-after-business-hours/44552)

<div class="topic-metadata">

**Author:** [@Omkar\_B](https://community.dynatrace.com/u/Omkar_B)\
**Replies:** 11\
**Last updated:** [October 9, 2024, 2:20am UTC](https://community.dynatrace.com/t/build-workflow-to-send-sms-notification-for-problems-detected-after-business-hours/44552 "2024-10-09T02:20:02Z")

</div>

Hello Team, Can someone help me to build workflow for below use case : We want Dynatrace to send SMS notification for problems generated between 18:00 To 06:00(nextDay) monday to friday if the impacted entity falls und…

---

## [Resolve Missing Metric Key Issues in DQL Queries](https://community.dynatrace.com/t/resolve-missing-metric-key-issues-in-dql-queries/48185)

<div class="topic-metadata">

**Author:** [@Etienne1](https://community.dynatrace.com/u/Etienne1)\
**Replies:** 3\
**Last updated:** [October 8, 2024, 10:01am UTC](https://community.dynatrace.com/t/resolve-missing-metric-key-issues-in-dql-queries/48185 "2024-10-08T10:01:36Z")

</div>

Hello, Can i use this metric key : “builtin:tech.generic.cpu.totalTime” in Grail cause i need it in my DQL, it does not appear in the documentation (Built-in Metrics on Grail — Dynatrace Docs) And I don’t see it suppor…

---

## [Extract logs via API](https://community.dynatrace.com/t/extract-logs-via-api/45118)

<div class="topic-metadata">

**Author:** [@wellpplava](https://community.dynatrace.com/u/wellpplava)\
**Replies:** 1\
**Last updated:** [October 8, 2024, 6:47am UTC](https://community.dynatrace.com/t/extract-logs-via-api/45118 "2024-10-08T06:47:09Z")

</div>

Hello! I need to extract a large volume of data from Grail. It was not possible through the Notebook because I reached the limit of 100000 records, I need data from the last 30 days, but I can extract it in 24-hour amo…

---

## [Parse String Values into Arrays Using Dynatrace DQL](https://community.dynatrace.com/t/parse-string-values-into-arrays-using-dynatrace-dql/48144)

<div class="topic-metadata">

**Author:** [@Gib80](https://community.dynatrace.com/u/Gib80)\
**Replies:** 3\
**Last updated:** [October 7, 2024, 1:45pm UTC](https://community.dynatrace.com/t/parse-string-values-into-arrays-using-dynatrace-dql/48144 "2024-10-07T13:45:12Z")

</div>

Summary: This thread shows how to parse string data into array structures in DQL. It includes examples of splitting fields and working with the resulting array elements. Good Afternoon, Is it possible to convert a stri…

---

## [DQL Dashboard - the average and maximum response times per 30 seconds](https://community.dynatrace.com/t/dql-dashboard-the-average-and-maximum-response-times-per-30-seconds/48142)

<div class="topic-metadata">

**Author:** [@Gib80](https://community.dynatrace.com/u/Gib80)\
**Replies:** 3\
**Last updated:** [October 4, 2024, 10:25am UTC](https://community.dynatrace.com/t/dql-dashboard-the-average-and-maximum-response-times-per-30-seconds/48142 "2024-10-04T10:25:29Z")

</div>

Hi All, I have created a timeseries DQL for a dashboard and I have got so far and I’m now stuck. I need it to look like the attached image. I need it to show the average and maximum response times (using the elapsed fie…

---

## [DQL TimeSeries](https://community.dynatrace.com/t/dql-timeseries/48138)

<div class="topic-metadata">

**Author:** [@Gib80](https://community.dynatrace.com/u/Gib80)\
**Replies:** 2\
**Last updated:** [October 4, 2024, 8:35am UTC](https://community.dynatrace.com/t/dql-timeseries/48138 "2024-10-04T08:35:05Z")

</div>

Hi All, I have created a timeseries DQL for a dashboard and I have got so far and I’m now stuck. It produces a line chart for me, but I need the CountofRecords to be one value per 30 min interval (see attached image). …

---

## [Log Metrics Extraction with a contains clause](https://community.dynatrace.com/t/log-metrics-extraction-with-a-contains-clause/48134)

<div class="topic-metadata">

**Author:** [@dcole66](https://community.dynatrace.com/u/dcole66)\
**Replies:** 4\
**Last updated:** [October 4, 2024, 4:38am UTC](https://community.dynatrace.com/t/log-metrics-extraction-with-a-contains-clause/48134 "2024-10-04T04:38:59Z")

</div>

DQL matcher in logs - Dynatrace Docs Why can I not, according to the documentation, use: log.source = “mytest” and matchesPhrase(content, “Some text”) to create a log metric from a log file. I get a LWL Validation err…

---

## [Querying CPU Comparison with Custom Tags in DQL](https://community.dynatrace.com/t/querying-cpu-comparison-with-custom-tags-in-dql/48087)

<div class="topic-metadata">

**Author:** [@VictorRuiz](https://community.dynatrace.com/u/VictorRuiz)\
**Replies:** 1\
**Last updated:** [October 3, 2024, 2:39pm UTC](https://community.dynatrace.com/t/querying-cpu-comparison-with-custom-tags-in-dql/48087 "2024-10-03T14:39:36Z")

</div>

Hello everyone, I am new to the DQL language and I would like to ask if it is possible to make a CPU comparison with the average of all hosts entities that are included by several tags. Let me explain, I have this quer…

---

## [how to display the number of problems and trends?](https://community.dynatrace.com/t/how-to-display-the-number-of-problems-and-trends/48092)

<div class="topic-metadata">

**Author:** [@Taihei](https://community.dynatrace.com/u/Taihei)\
**Replies:** 2\
**Last updated:** [October 2, 2024, 8:43pm UTC](https://community.dynatrace.com/t/how-to-display-the-number-of-problems-and-trends/48092 "2024-10-02T20:43:33Z")

</div>

I would like to use the single value visualization on the dashboard to display the number of PROBLEMS and trends by ENTITY TYPE. I was able to display the following DQL for the number of PROBLEMS. How can I display tre…

---

## [Add a timestamp/day filter on an existing DQL tile](https://community.dynatrace.com/t/add-a-timestamp-day-filter-on-an-existing-dql-tile/48007)

<div class="topic-metadata">

**Author:** [@sandytheSeeker](https://community.dynatrace.com/u/sandytheSeeker)\
**Replies:** 5\
**Last updated:** [September 30, 2024, 8:48pm UTC](https://community.dynatrace.com/t/add-a-timestamp-day-filter-on-an-existing-dql-tile/48007 "2024-09-30T20:48:41Z")

</div>

Hello All, I want to restrict my output to last 7 days everytime the dashboard refreshes. I have a tile which bring me all the failed job list. I want to restrict it programatically to get only last 7 days. My tile code…

---

## [Querying services related to an entity](https://community.dynatrace.com/t/querying-services-related-to-an-entity/47960)

<div class="topic-metadata">

**Author:** [@DamianJankowski](https://community.dynatrace.com/u/DamianJankowski)\
**Replies:** 2\
**Last updated:** [September 28, 2024, 5:27pm UTC](https://community.dynatrace.com/t/querying-services-related-to-an-entity/47960 "2024-09-28T17:27:56Z")

</div>

I want to create a line chart that displays the response time metric for a selected service. I need it to be dynamic, so I’ve set up a variable. Here’s the variable definition: fetch dt.entity.service | fields entity.na…

---

## [Policy Grail](https://community.dynatrace.com/t/policy-grail/47994)

<div class="topic-metadata">

**Author:** [@vpasinelli](https://community.dynatrace.com/u/vpasinelli)\
**Replies:** 1\
**Last updated:** [September 26, 2024, 10:23pm UTC](https://community.dynatrace.com/t/policy-grail/47994 "2024-09-26T22:23:11Z")

</div>

Hi, We have just introduced Grail into our tenant Dynatrace. We previously divided the view of various data by menagament zones and user groups. Now we will need to create grail policies that maintain these distinctions…

---

## [Timeseries returns timestamp](https://community.dynatrace.com/t/timeseries-returns-timestamp/47723)

<div class="topic-metadata">

**Author:** [@RPbiaggio](https://community.dynatrace.com/u/RPbiaggio)\
**Replies:** 2\
**Last updated:** [September 26, 2024, 4:00pm UTC](https://community.dynatrace.com/t/timeseries-returns-timestamp/47723 "2024-09-26T16:00:24Z")

</div>

Guys, I need to collect data on the volume of requests, for example, but considering only a specific period, for example, only Monday to Friday, from 9:00am to 6pm Has anyone done this? Can you tell me if it is possible…

---

## [Display Rate Values in Timeseries Using Dynatrace DQL](https://community.dynatrace.com/t/display-rate-values-in-timeseries-using-dynatrace-dql/47939)

<div class="topic-metadata">

**Author:** [@Kaayush](https://community.dynatrace.com/u/Kaayush)\
**Replies:** 5\
**Last updated:** [September 26, 2024, 2:07pm UTC](https://community.dynatrace.com/t/display-rate-values-in-timeseries-using-dynatrace-dql/47939 "2024-09-26T14:07:12Z")

</div>

Summary: This post explains how to compute a rate (per second, per minute, etc.) within a DQL timeseries query. It includes example syntax and considerations for correct rate calculation. data record(timestamp = now(), …

---

## [DPL Help Pls](https://community.dynatrace.com/t/dpl-help-pls/47979)

<div class="topic-metadata">

**Author:** [@DwayneWhite](https://community.dynatrace.com/u/DwayneWhite)\
**Replies:** 2\
**Last updated:** [September 26, 2024, 1:14pm UTC](https://community.dynatrace.com/t/dpl-help-pls/47979 "2024-09-26T13:14:04Z")

</div>

Using the below Data, I was attempting to extract the folder and the file from this example log entry. Here is what I started with and got no further. Any guidance would be greatly appreciated. TIMESTAMP(“yyyy-MM-dd H…

---

## [Output of total number of http errors using DQL](https://community.dynatrace.com/t/output-of-total-number-of-http-errors-using-dql/47963)

<div class="topic-metadata">

**Author:** [@Taihei](https://community.dynatrace.com/u/Taihei)\
**Replies:** 5\
**Last updated:** [September 26, 2024, 12:51am UTC](https://community.dynatrace.com/t/output-of-total-number-of-http-errors-using-dql/47963 "2024-09-26T00:51:10Z")

</div>

Please tell me how to output the total “reqcount” value in the following DQL. timeseries reqcount=sum(dt.service.request.count, default:0), by:{http.response.status\_code}, filter:{ dt.entity.service == “XXXXXXX” and…

---

## [Calculate time difference between two records](https://community.dynatrace.com/t/calculate-time-difference-between-two-records/47921)

<div class="topic-metadata">

**Author:** [@Sona282](https://community.dynatrace.com/u/Sona282)\
**Replies:** 2\
**Last updated:** [September 25, 2024, 4:35pm UTC](https://community.dynatrace.com/t/calculate-time-difference-between-two-records/47921 "2024-09-25T16:35:40Z")

</div>

Hello, I want to calculate the time difference the current record and previous record, until the end of the record. example, Thank you.

---

## [Converting DQL into timeseries](https://community.dynatrace.com/t/converting-dql-into-timeseries/47757)

<div class="topic-metadata">

**Author:** [@AK](https://community.dynatrace.com/u/AK)\
**Replies:** 5\
**Last updated:** [September 19, 2024, 2:27pm UTC](https://community.dynatrace.com/t/converting-dql-into-timeseries/47757 "2024-09-19T14:27:08Z")

</div>

Hello Folks, Need some help in converting following query into timeseries as I wanted to use it in Davis anomaly detection. Is it possible? fetch logs, from:now() - 4h | filter contains(dt.process.name, "process\_name"…

[Previous page](https://community.dynatrace.com/c/platform/dql/83.md?page=18)

[Next page](https://community.dynatrace.com/c/platform/dql/83.md?page=20)
