# DQL

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

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

**Page:** 21

---

## [How to query for spans that has an exception event?](https://community.dynatrace.com/t/how-to-query-for-spans-that-has-an-exception-event/47692)

<div class="topic-metadata">

**Author:** [@bren](https://community.dynatrace.com/u/bren)\
**Replies:** 1\
**Last updated:** [September 16, 2024, 7:48am UTC](https://community.dynatrace.com/t/how-to-query-for-spans-that-has-an-exception-event/47692 "2024-09-16T07:48:37Z")

</div>

Hi, When I do a simple DQL query on the spans, I can see some spans have exceptions like below. The exceptions are wrapped as records in an array under “span.events” field. How do I write a DQL query to pick out spans …

---

## [DQL for Promblems: Filter by Management Zone](https://community.dynatrace.com/t/dql-for-promblems-filter-by-management-zone/47655)

<div class="topic-metadata">

**Author:** [@aganpathi](https://community.dynatrace.com/u/aganpathi)\
**Replies:** 1\
**Last updated:** [September 16, 2024, 4:31am UTC](https://community.dynatrace.com/t/dql-for-promblems-filter-by-management-zone/47655 "2024-09-16T04:31:15Z")

</div>

I’m writing a DQL query to fetch dt.davis.problems and filter it by Management Zone to create a panel in the new Dashboard app similar to the Classic Dashboard app. This is what I’ve written so far to get the Davis prob…

---

## [Logs DQL query to fetch user selected current timeframe](https://community.dynatrace.com/t/logs-dql-query-to-fetch-user-selected-current-timeframe/47632)

<div class="topic-metadata">

**Author:** [@gcnaidu](https://community.dynatrace.com/u/gcnaidu)\
**Replies:** 2\
**Last updated:** [September 13, 2024, 6:46am UTC](https://community.dynatrace.com/t/logs-dql-query-to-fetch-user-selected-current-timeframe/47632 "2024-09-13T06:46:12Z")

</div>

Query: fetch logs, from:now()-2h Instead of from:now()-2h,k I would like to pass user selected range (Current timeframe) dynamically and fetch logs accordingly

---

## [Parse Json logs with a compact json formatter](https://community.dynatrace.com/t/parse-json-logs-with-a-compact-json-formatter/47597)

<div class="topic-metadata">

**Author:** [@faraz](https://community.dynatrace.com/u/faraz)\
**Replies:** 2\
**Last updated:** [September 11, 2024, 11:29pm UTC](https://community.dynatrace.com/t/parse-json-logs-with-a-compact-json-formatter/47597 "2024-09-11T23:29:43Z")

</div>

Hi, I am trying to come up with a query to parse the incoming log with compact json format from Serilog The problem I am facing is I cant use @ for the matcher name. Sample log {“@t”:“2024-09-11T05:25:43.6670035Z”,“@…

---

## [Grail Log Permission Policies](https://community.dynatrace.com/t/grail-log-permission-policies/47578)

<div class="topic-metadata">

**Author:** [@nicemukesh](https://community.dynatrace.com/u/nicemukesh)\
**Replies:** 1\
**Last updated:** [September 11, 2024, 8:48am UTC](https://community.dynatrace.com/t/grail-log-permission-policies/47578 "2024-09-11T08:48:31Z")

</div>

As we switched over to Grail and want to write policies to limit the users to there specific name space logs access only how can we write a generic policy as we have 6k+ namespaces can we use RBAC hee and how ? Mukesh

---

## [Timeseries with one record, but start and end event](https://community.dynatrace.com/t/timeseries-with-one-record-but-start-and-end-event/47352)

<div class="topic-metadata">

**Author:** [@Ellery](https://community.dynatrace.com/u/Ellery)\
**Replies:** 3\
**Last updated:** [September 10, 2024, 2:17am UTC](https://community.dynatrace.com/t/timeseries-with-one-record-but-start-and-end-event/47352 "2024-09-10T02:17:10Z")

</div>

Hello friends, I’m back with another question. In DQL, I need to do the following: I have a record that contains the start time and end time of a problem or event, and I would like to transform this record into a time se…

---

## [Converting splunk query to DQL timeseries](https://community.dynatrace.com/t/converting-splunk-query-to-dql-timeseries/47549)

<div class="topic-metadata">

**Author:** [@esm9374\_hca](https://community.dynatrace.com/u/esm9374_hca)\
**Replies:** 1\
**Last updated:** [September 9, 2024, 11:11pm UTC](https://community.dynatrace.com/t/converting-splunk-query-to-dql-timeseries/47549 "2024-09-09T23:11:56Z")

</div>

I am in process of rebuilding all of our Splunk Dashboards over to Dynatrace Dashboards. A lot of our Dashboards are asking us for the latest value. Below is the splunk query. | mstats latest(vault.token.count.by\_auth.v…

---

## [DQL Dashboard queries for Service request or End points](https://community.dynatrace.com/t/dql-dashboard-queries-for-service-request-or-end-points/47512)

<div class="topic-metadata">

**Author:** [@ManoharSomineni](https://community.dynatrace.com/u/ManoharSomineni)\
**Replies:** 7\
**Last updated:** [September 6, 2024, 7:19am UTC](https://community.dynatrace.com/t/dql-dashboard-queries-for-service-request-or-end-points/47512 "2024-09-06T07:19:40Z")

</div>

I am trying to create Dashboard charts of Number of Request chart, Failed request count chart and successful request count chart for storeBooking in BookingService service in Easy Travel application. Kindly provide the …

---

## [Find all host\_groups with hosts that have a specific tag](https://community.dynatrace.com/t/find-all-host-groups-with-hosts-that-have-a-specific-tag/40004)

<div class="topic-metadata">

**Author:** [@sinisa\_zubic](https://community.dynatrace.com/u/sinisa_zubic)\
**Replies:** 3\
**Last updated:** [September 5, 2024, 6:43pm UTC](https://community.dynatrace.com/t/find-all-host-groups-with-hosts-that-have-a-specific-tag/40004 "2024-09-05T18:43:25Z")

</div>

Hi there,How would one find all host\_groups with hosts that have a specific tag? Something like: fetch dt.entity.host\_group | filter in(id,\[fetch dt.entity.host |filter matchesValue(tags,"MyTag")|fields id\]) I still st…

---

## [DQL: How can I convert row values to column headings](https://community.dynatrace.com/t/dql-how-can-i-convert-row-values-to-column-headings/47445)

<div class="topic-metadata">

**Author:** [@HeadScratcher](https://community.dynatrace.com/u/HeadScratcher)\
**Replies:** 2\
**Last updated:** [September 4, 2024, 3:10pm UTC](https://community.dynatrace.com/t/dql-how-can-i-convert-row-values-to-column-headings/47445 "2024-09-04T15:10:54Z")

</div>

I have some DQL that looks at a web servers log files and counts the number of hits on services gives me data in a table like this: service\_name status\_code hit\_count checkOut 200 1234 checkOut 404 1 I woul…

---

## [DQL query to fetch hosts via ostype](https://community.dynatrace.com/t/dql-query-to-fetch-hosts-via-ostype/47457)

<div class="topic-metadata">

**Author:** [@huzoor](https://community.dynatrace.com/u/huzoor)\
**Replies:** 7\
**Last updated:** [September 3, 2024, 8:29pm UTC](https://community.dynatrace.com/t/dql-query-to-fetch-hosts-via-ostype/47457 "2024-09-03T20:29:43Z")

</div>

Hi, I am new to DQL query stuff, can anyone tell me the query to use to fetch the hostgroups which have hosts running on ostype like linux and windows and also along with monitoringmode they are configured on ?

---

## [Flatten Arrays in Dynatrace Query Language (DQL)](https://community.dynatrace.com/t/flatten-arrays-in-dynatrace-query-language-dql/46708)

<div class="topic-metadata">

**Author:** [@36Krazyfists](https://community.dynatrace.com/u/36Krazyfists)\
**Replies:** 3\
**Last updated:** [September 3, 2024, 9:13am UTC](https://community.dynatrace.com/t/flatten-arrays-in-dynatrace-query-language-dql/46708 "2024-09-03T09:13:50Z")

</div>

Summary: This article demonstrates how to flatten arrays using DQL functions. It provides syntax examples and practical use cases for transforming complex data structures in Dynatrace dashboards. So you can flatten reco…

---

## [Add getDayOfYear array as a filter in "if else" check - help with syntax](https://community.dynatrace.com/t/add-getdayofyear-array-as-a-filter-in-if-else-check-help-with-syntax/47375)

<div class="topic-metadata">

**Author:** [@AlanFoley](https://community.dynatrace.com/u/AlanFoley)\
**Replies:** 2\
**Last updated:** [September 3, 2024, 4:39am UTC](https://community.dynatrace.com/t/add-getdayofyear-array-as-a-filter-in-if-else-check-help-with-syntax/47375 "2024-09-03T04:39:23Z")

</div>

Hi All I am working worth a service metric - in this case Response Time - where I want to split by Business Hours (BH) and Non Business Hours (NBH) - this works fine as I also include Sat and Sat into NBH The next step…

---

## [Extract TAG values from hosts tags in DQL](https://community.dynatrace.com/t/extract-tag-values-from-hosts-tags-in-dql/40394)

<div class="topic-metadata">

**Author:** [@DavidePiras](https://community.dynatrace.com/u/DavidePiras)\
**Replies:** 3\
**Last updated:** [September 2, 2024, 2:37pm UTC](https://community.dynatrace.com/t/extract-tag-values-from-hosts-tags-in-dql/40394 "2024-09-02T14:37:53Z")

</div>

I am querying the list of hosts in our environment, i would need to also filter by presence of a tag and to see the tag name and value in a column of the resulting table, I am using this query to start with: fetch dt.e…

---

## [Convert String to Integer in Dynatrace Query Language (DQL)](https://community.dynatrace.com/t/convert-string-to-integer-in-dynatrace-query-language-dql/47106)

<div class="topic-metadata">

**Author:** [@nikhilchandra](https://community.dynatrace.com/u/nikhilchandra)\
**Replies:** 2\
**Last updated:** [September 1, 2024, 9:32am UTC](https://community.dynatrace.com/t/convert-string-to-integer-in-dynatrace-query-language-dql/47106 "2024-09-01T09:32:03Z")

</div>

Summary: This thread explains how to use DQL functions to convert string values into numeric or integer formats. It includes syntax examples and practical use cases for data transformation in Dynatrace dashboards. Hi Ex…

---

## [DQL Fetch Logs Averages](https://community.dynatrace.com/t/dql-fetch-logs-averages/47384)

<div class="topic-metadata">

**Author:** [@Gib80](https://community.dynatrace.com/u/Gib80)\
**Replies:** 1\
**Last updated:** [August 30, 2024, 8:57pm UTC](https://community.dynatrace.com/t/dql-fetch-logs-averages/47384 "2024-08-30T20:57:18Z")

</div>

Hi All, I am currently trying to write some dql which will provide some graphical data from the fetch logs command. This is the fetch logs command I have so far below. I need to average the results by 1day and 7days, …

---

## [A string like "ABCDEFG" isn't allowed here ERROR  when using CSV variables with DQL on dashboards v2.0](https://community.dynatrace.com/t/a-string-like-abcdefg-isnt-allowed-here-error-when-using-csv-variables-with-dql-on-dashboards-v2-0/47414)

<div class="topic-metadata">

**Author:** [@MariettaAlmeida](https://community.dynatrace.com/u/MariettaAlmeida)\
**Replies:** 1\
**Last updated:** [August 30, 2024, 8:43pm UTC](https://community.dynatrace.com/t/a-string-like-abcdefg-isnt-allowed-here-error-when-using-csv-variables-with-dql-on-dashboards-v2-0/47414 "2024-08-30T20:43:37Z")

</div>

hi all, when using a list of variables with CSV option that references hypervisors and ESXI host tags, i get this error on DQL query: --A string like “xxxx” isn’t allowed here. Please check the autocomplete suggestions…

---

## [How to calculate Average of "Response Time", Please help me with query?](https://community.dynatrace.com/t/how-to-calculate-average-of-response-time-please-help-me-with-query/47389)

<div class="topic-metadata">

**Author:** [@Dynatracer1218](https://community.dynatrace.com/u/Dynatracer1218)\
**Replies:** 1\
**Last updated:** [August 29, 2024, 4:25pm UTC](https://community.dynatrace.com/t/how-to-calculate-average-of-response-time-please-help-me-with-query/47389 "2024-08-29T16:25:48Z")

</div>

Hi, I am trying to write query to get “Response Time” Average. I am getting Null, when I ran the below query. Can someone please help me on how to calculate the Average of “Response Time”? Thanks in Advance!

---

## [Expand DQL TimeFrame](https://community.dynatrace.com/t/expand-dql-timeframe/47230)

<div class="topic-metadata">

**Author:** [@WessOtter](https://community.dynatrace.com/u/WessOtter)\
**Replies:** 1\
**Last updated:** [August 29, 2024, 11:59am UTC](https://community.dynatrace.com/t/expand-dql-timeframe/47230 "2024-08-29T11:59:25Z")

</div>

Hi, I am trying to create a row-by-row comparison in DQL. However, the query so far is a time frame and hence one row. I want to create a row for each interval in the time frame. But I can’t find a way to expand this ti…

---

## [Making timeseries from logs](https://community.dynatrace.com/t/making-timeseries-from-logs/47249)

<div class="topic-metadata">

**Author:** [@PiotrJS](https://community.dynatrace.com/u/PiotrJS)\
**Replies:** 1\
**Last updated:** [August 28, 2024, 8:43pm UTC](https://community.dynatrace.com/t/making-timeseries-from-logs/47249 "2024-08-28T20:43:31Z")

</div>

Hi, I would like to generate a simple line chart showing a connection status which goes from 0(closed) to 1(open). Quite simple but… I tried something like below but it did not work as I want. I think the problem I hav…

---

## [how to get starttime in Dynatrace DQL](https://community.dynatrace.com/t/how-to-get-starttime-in-dynatrace-dql/47113)

<div class="topic-metadata">

**Author:** [@nikhilchandra](https://community.dynatrace.com/u/nikhilchandra)\
**Replies:** 1\
**Last updated:** [August 13, 2024, 9:14pm UTC](https://community.dynatrace.com/t/how-to-get-starttime-in-dynatrace-dql/47113 "2024-08-13T21:14:42Z")

</div>

Hi I have endtime (timestamp format) and duration (duration format), i need starttime by redcucing the duration from endtime. I tried below but the output was wrong. Both start and end values are same. can someone help. …

---

## [DQL parsing Json and extracting new column](https://community.dynatrace.com/t/dql-parsing-json-and-extracting-new-column/47112)

<div class="topic-metadata">

**Author:** [@Yann\_Buccellato](https://community.dynatrace.com/u/Yann_Buccellato)\
**Replies:** 1\
**Last updated:** [August 13, 2024, 1:56pm UTC](https://community.dynatrace.com/t/dql-parsing-json-and-extracting-new-column/47112 "2024-08-13T13:56:42Z")

</div>

Good afternoon community, in my log line I have a field called: custom\_headers custom headers contains this value: {“id”:“261004620”,“name”:“OrderId”,“value”:“5602867201”}, {“id”:“260996569”,“name”:“xxxxother”,“v…

---

## [Lookup value from entity with the parsed value from logs](https://community.dynatrace.com/t/lookup-value-from-entity-with-the-parsed-value-from-logs/47101)

<div class="topic-metadata">

**Author:** [@zip-chanko](https://community.dynatrace.com/u/zip-chanko)\
**Replies:** 1\
**Last updated:** [August 10, 2024, 9:36am UTC](https://community.dynatrace.com/t/lookup-value-from-entity-with-the-parsed-value-from-logs/47101 "2024-08-10T09:36:16Z")

</div>

I have the content with json in logs which has a key client\_ip and trying to get the pod name which has internalIpAddresses from dt.entity.cloud\_application\_instance. So trying to lookup the IP I got from the logs client…

---

## [Query AWS EC2 Hosts Using DQL for Cloud Infrastructure Insights](https://community.dynatrace.com/t/query-aws-ec2-hosts-using-dql-for-cloud-infrastructure-insights/47069)

<div class="topic-metadata">

**Author:** [@flomaz](https://community.dynatrace.com/u/flomaz)\
**Replies:** 2\
**Last updated:** [August 9, 2024, 8:20am UTC](https://community.dynatrace.com/t/query-aws-ec2-hosts-using-dql-for-cloud-infrastructure-insights/47069 "2024-08-09T08:20:26Z")

</div>

Hello, In the user interface, I am able to see the AWS instance id of an AWS EC2 host even without configuring the AWS connector. How could I get the AWS instance id using the ‘fetch dt.entity.host’ query ?

---

## [Extract Information](https://community.dynatrace.com/t/extract-information/46954)

<div class="topic-metadata">

**Author:** [@carlos\_carreno](https://community.dynatrace.com/u/carlos_carreno)\
**Replies:** 1\
**Last updated:** [August 5, 2024, 7:01pm UTC](https://community.dynatrace.com/t/extract-information/46954 "2024-08-05T19:01:24Z")

</div>

Good morning, I need your support with this DPL/DQL text extraction. I need to parse it Samples /productos/creditos/en-linea /productos/creditos/libranza /productos/cdts /productos/cuentas-de-ahorro/abrir-cuenta-de-…

---

## [can I assign the variable to a field and display as a field in dashboard](https://community.dynatrace.com/t/can-i-assign-the-variable-to-a-field-and-display-as-a-field-in-dashboard/46926)

<div class="topic-metadata">

**Author:** [@susmita\_k](https://community.dynatrace.com/u/susmita_k)\
**Replies:** 4\
**Last updated:** [August 5, 2024, 5:48pm UTC](https://community.dynatrace.com/t/can-i-assign-the-variable-to-a-field-and-display-as-a-field-in-dashboard/46926 "2024-08-05T17:48:45Z")

</div>

can I assign the variable to a field and display as a field in dashboard ? I am trying this |fieldsAdd db\_instance ==$DBName but this is not working. Please help. Thank you.

---

## [keyRequests in Grail](https://community.dynatrace.com/t/keyrequests-in-grail/46959)

<div class="topic-metadata">

**Author:** [@mouru](https://community.dynatrace.com/u/mouru)\
**Replies:** 2\
**Last updated:** [August 2, 2024, 8:26am UTC](https://community.dynatrace.com/t/keyrequests-in-grail/46959 "2024-08-02T08:26:01Z")

</div>

Hello, I was trying my best to find my specified service keyRequests with DQL from Grail but failed to find any, these can be charted with Data Explorer but the pinning to new Dashboards v2 results in mapping the key fr…

---

## [\[Q\] - How to mask IPv6 on ingestion](https://community.dynatrace.com/t/q-how-to-mask-ipv6-on-ingestion/46846)

<div class="topic-metadata">

**Author:** [@mark\_forrester](https://community.dynatrace.com/u/mark_forrester)\
**Replies:** 5\
**Last updated:** [August 1, 2024, 7:33am UTC](https://community.dynatrace.com/t/q-how-to-mask-ipv6-on-ingestion/46846 "2024-08-01T07:33:07Z")

</div>

Hi Community I’m trying to mask a IPv6 address on log ingestion but struggling to get the commad right I find the IPv6 in the logs using the following command // detect ip | parse content, “LD IPADDR:ip LD” | fields…

---

## [DQL to compare requested pods vs running pods ( k8s )](https://community.dynatrace.com/t/dql-to-compare-requested-pods-vs-running-pods-k8s/46857)

<div class="topic-metadata">

**Author:** [@PeterDrenth1](https://community.dynatrace.com/u/PeterDrenth1)\
**Replies:** 1\
**Last updated:** [July 29, 2024, 8:20am UTC](https://community.dynatrace.com/t/dql-to-compare-requested-pods-vs-running-pods-k8s/46857 "2024-07-29T08:20:24Z")

</div>

I’m looking for a way to determine if requested pods is equal to the running pods for specific apps in a specific namespace on a specific Kubernetes cluster. Ideally if running pods = 0 we throw an alert with status CRI…

---

## [Unexpected behavior in Log Processing](https://community.dynatrace.com/t/unexpected-behavior-in-log-processing/46665)

<div class="topic-metadata">

**Author:** [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Replies:** 4\
**Last updated:** [July 26, 2024, 5:24pm UTC](https://community.dynatrace.com/t/unexpected-behavior-in-log-processing/46665 "2024-07-26T17:24:33Z")

</div>

Hello Community, I’ve been facing a hard and intensive migration from another brand (:page\_facing\_up::dog:) to Dynatrace Grail. The following is only one example but I have the same erratic behavior with other rules. I…

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

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