# DQL function replacing splunk command stats list

**URL:** <https://community.dynatrace.com/t/dql-function-replacing-splunk-command-stats-list/52754>\
**Category:** DQL\
**Tags:** dql, notebooks, dpl, logs\
**Created:** [July 31, 2025, 7:17pm UTC](https://community.dynatrace.com/t/dql-function-replacing-splunk-command-stats-list/52754 "2025-07-31T19:17:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![susmita\_k](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@susmita\_k](https://community.dynatrace.com/u/susmita_k)\
**Post date:** [July 31, 2025, 7:17pm UTC](https://community.dynatrace.com/t/dql-function-replacing-splunk-command-stats-list/52754/1 "2025-07-31T19:17:35Z")

</div>

is there a DQL Command/function available which can replace the stats list command in splunk ? Thanks in advance

---

<div class="post-metadata">

**Author:** ![angelalanis](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@angelalanis](https://community.dynatrace.com/u/angelalanis)\
**Post date:** [August 1, 2025, 5:39pm UTC](https://community.dynatrace.com/t/dql-function-replacing-splunk-command-stats-list/52754/2 "2025-08-01T17:39:59Z")

</div>

Hi, the stats command in Splunk is an aggregation command, in Dynatrace with DQL there are 3 [aggregation commands](https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-query-language/commands/aggregation-commands).

Looking at [this example](https://help.splunk.com/en/splunk-cloud-platform/search/spl2-search-reference/stats-command/stats-command-overview-syntax-and-usage#:~:text=quantity)%2C%20min(quantity)-,The%20results%20look%20like%20this%3A,-count(productId)) in the Splunk documentation, I think something similar can be made using the summarize command with DQL.

I tried making this example in a Notebook, here are the results.

```markup
fetch logs
| filter matchesPhrase(content, "long transaction")
| parse content, """LD 'type ['LD:type']'"""
| parse content, """LD 'duration ['INT:duration']'"""
| summarize {count(), sum(duration), avg(duration), max(duration), min(duration)}, by:{type}

```

 ![angelalanis_1-1754070014813.png](https://global.discourse-cdn.com/dynatrace/original/3X/b/1/b13159c480af96bdd68a2234332e71ed09f110cd.png)

Let me know if you find this useful.
