# Combine makeTimeseries with Summarize in DQL for Advanced Analysis

**URL:** <https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984>\
**Category:** DQL\
**Tags:** dql, events, logs\
**Created:** [November 4, 2025, 5:08pm UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984 "2025-11-04T17:08:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joao1](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@Joao1](https://community.dynatrace.com/u/Joao1)\
**Post date:** [November 4, 2025, 5:08pm UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984/1 "2025-11-04T17:08:26Z")

</div>

We had a requirement:

To alert when a certain event ID in the Application Log didn’t occur in a time window of 2 hours.

Since metric events have a limit of 60 minutes in its violating window, we talked internally and thought about the following process:

1. First create a CUSTOM\_INFO event through pipeline to look for that event with a dt.davis.timeout of 120 minutes.

2. Create a Davis Anomaly Detector to look at the amount of ACTIVE events at ANY time to see if it was below 1. If it was, then we would create the problem.

Problem:

We’re currently having trouble creating the necessary DQL to create a timeseries based on a Summarize (which is the count of the total ACTIVE events at any time).

This is the DQL we currently managed to create:

fetch events  
| filter event.status == “ACTIVE”  
and event.type == “CUSTOM\_INFO”  
and matchesPhrase(event.name, “Event”)  
| summarize totalCount = count(), by:{timestamp=bin(timestamp,1m)}  
| makeTimeseries test = avg(totalCount), by:{timestamp}

Appreciate your help! Thanks in advance.

João

---

<div class="post-metadata">

**Author:** ![JeanBlanc](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jeanblanc/32/25897_2.png) [@JeanBlanc](https://community.dynatrace.com/u/JeanBlanc)\
**Post date:** [November 5, 2025, 2:10pm UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984/2 "2025-11-05T14:10:09Z")

</div>

Hi João 👋

You’re very close — your DQL is already correct in principle.  
However, it’s not necessary to explicitly specify by:{timestamp} in the makeTimeseries function.

The time dimension is implicit: makeTimeseries automatically interprets the aggregated data over time (based on the timestamp field). So you can simplify your query as follows:

```javascript
fetch events
| filter event.status == "ACTIVE"
and event.type == "CUSTOM_INFO"
and matchesPhrase(event.name, "Event")
| summarize totalCount = count(), by:{timestamp=bin(timestamp,1m)}
| makeTimeseries test = avg(totalCount)

```

This will produce the same result — the by:timestamp is redundant because the function already treats the timestamp as the time dimension by default.

Best regards,

---

<div class="post-metadata">

**Author:** ![Joao1](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@Joao1](https://community.dynatrace.com/u/Joao1)\
**Post date:** [November 5, 2025, 2:15pm UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984/3 "2025-11-05T14:15:34Z")

</div>

Hi Jean,

I used your query, with the following results:

 ![Joao1_0-1762352015612.png](https://global.discourse-cdn.com/dynatrace/original/2X/1/125d060b999c1ce2973971c20b17cca6295d4405.png)

The problem is still the same, this query shows when the events happened at a certain time. And what we want is&nbsp;the count of the total ACTIVE events at any time, which should be a continuous line of (in this case with a timeframe of 2 hours) value 4. Is this possible?

---

<div class="post-metadata">

**Author:** ![JeanBlanc](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jeanblanc/32/25897_2.png) [@JeanBlanc](https://community.dynatrace.com/u/JeanBlanc)\
**Post date:** [November 5, 2025, 2:37pm UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984/4 "2025-11-05T14:37:28Z")

</div>

Ah, I see — I might have misunderstood your goal earlier.  
If what you want is to group and count the **ACTIVE** events over a 2-hour period, you can try something like this:

```javascript
fetch events 
| filter event.status == "ACTIVE" and event.type == "CUSTOM_INFO" and matchesPhrase(event.name, "Event") 
| summarize totalCount = count(), by:{timestamp=bin(timestamp, 2h)} 
| makeTimeseries test = avg(totalCount)

```

This should group your active events into 2-hour windows and show a more stable count over time.

Best,  
Jean

---

<div class="post-metadata">

**Author:** ![Joao1](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@Joao1](https://community.dynatrace.com/u/Joao1)\
**Post date:** [November 5, 2025, 2:44pm UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984/5 "2025-11-05T14:44:14Z")

</div>

Hey Jean,

Still not what we’re trying to accomplish. That query still returns the datapoints based on when they arrived. We want to create a anomaly detector based on the amount of active events with that filter at any time completely disregarding when they arrived. But i do understand we need a timeframe for the anomaly detector to work, and that is the issue.

---

<div class="post-metadata">

**Author:** ![JeanBlanc](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jeanblanc/32/25897_2.png) [@JeanBlanc](https://community.dynatrace.com/u/JeanBlanc)\
**Post date:** [November 5, 2025, 2:49pm UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984/6 "2025-11-05T14:49:09Z")

</div>

Yes, Davis Anomaly Detector only works with a timeseries metric and a timeframe from 1 to 60 minutes.

Maybe you need to create a metric based on your needs and then create a detector to alert when an issue occured.

Best regards,

---

<div class="post-metadata">

**Author:** ![Joao1](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@Joao1](https://community.dynatrace.com/u/Joao1)\
**Post date:** [November 5, 2025, 2:53pm UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984/7 "2025-11-05T14:53:21Z")

</div>

We didn’t create a metric because of specific problem of a timeframe from 1 to 60 minutes. The solution we found is explained in the original post in the step 1 and 2. And we’re stuck on step 2.

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [November 6, 2025, 9:48am UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984/8 "2025-11-06T09:48:23Z")

</div>

[@Joao1](https://community.dynatrace.com/user/63241)&nbsp;to solve the challenge, I’d not use Davis Anomaly Detector (which requires time series data and works on last hour data only), but site reliability guardian instead. Trigger it from a simple workflow. Raise Davis problem opening event in an open pipeline processing the site reliability guardian.

CC [@PedroDeodato](https://community.dynatrace.com/user/40725) / [@PedroSantos](https://community.dynatrace.com/user/77112)

---

<div class="post-metadata">

**Author:** ![Joao1](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@Joao1](https://community.dynatrace.com/u/Joao1)\
**Post date:** [November 6, 2025, 1:43pm UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984/9 "2025-11-06T13:43:54Z")

</div>

Hello Julius,

So, something like this?

 ![Joao1_0-1762436612256.png](https://global.discourse-cdn.com/dynatrace/original/2X/d/d455b4e169b71a3fb33aa67b946357cf681f5b8b.png)

Regards,

Joao

---

<div class="post-metadata">

**Author:** ![PedroDeodato](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pedrodeodato/32/32284_2.png) [@PedroDeodato](https://community.dynatrace.com/u/PedroDeodato)\
**Post date:** [November 6, 2025, 6:06pm UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984/10 "2025-11-06T18:06:04Z")

</div>

You are truly a legend,&nbsp;[@Julius\_Loman](https://community.dynatrace.com/user/3364)&nbsp;!!

Will definitely try it out!

Thank you very much!

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [November 7, 2025, 10:29am UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984/11 "2025-11-07T10:29:02Z")

</div>

You can do that on the logs directly.&nbsp;  
On events, I would not filter on active status. Initially, your requirement is:

> To alert when a certain event ID in the Application Log didn’t occur in a time window of 2 hours.

So if you create some events from logs, you just want to query and summarize. Just if you want to grab it as a davis event, you might need to filter on event.start and not only on timestamp as for non-active events, the timestamp represents the time when the event changed its status to closed for example.

```markup
fetch dt.davis.events, from:-2h
| filter matchesPhrase(event.name, "Event")
| filter event.category=="CUSTOM_ALERT"
| filter event.start>now()-2h
| summarize count()

```

---

<div class="post-metadata">

**Author:** ![Joao1](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@Joao1](https://community.dynatrace.com/u/Joao1)\
**Post date:** [November 19, 2025, 9:37am UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984/12 "2025-11-19T09:37:37Z")

</div>

So, i assume guardian can validate on a determined timeframe, in this case 2 hours, so that means i don’t have to strictly use events. Instead i can query logs directly as you said and then configure the guardian to alert when the count is below 0 on a 2 hour timeframe, correct?

---

<div class="post-metadata">

**Author:** ![Joao1](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@Joao1](https://community.dynatrace.com/u/Joao1)\
**Post date:** [November 19, 2025, 9:42am UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984/13 "2025-11-19T09:42:08Z")

</div>

Julian, my question now is if the Guardian opens the problem by itself, or do i need a workflow to look at the guardian and open a problem based on its validation?

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [November 19, 2025, 11:30am UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984/14 "2025-11-19T11:30:16Z")

</div>

[@Joao1](https://community.dynatrace.com/user/63241)&nbsp;SRG does not open any Davis problems. You can do that in the openpipeline:  
First create a bizevents OpenPipeline pipeline:  
Add a DQL processing step matching:

```markup
event.type == "guardian.validation.objective"

```

with DQL:

```markup
parse `guardian.objective`, """JSON:objective"""
| fieldsAdd objective.name=objective[name]
, objective.objectiveType=objective[objectiveType]
, objective.dqlQuery=objective[dqlQuery]
, objective.comparisonOperator=objective[comparisonOperator]
, objective.target=objective[target]
, objective.warning=objective[warning]
, objective.status=objective[status]
, objective.value=objective[value]
, objective.fieldName=objective[fieldName]
| fieldsRemove objective

```

This will help you to preprocess the objective validation results.

In the Davis tab in the pipeline, create a Davis event when conditions match, example below. Adapt Objective Name and Guardian ID

```markup
event.provider == "dynatrace.site.reliability.guardian" 
and event.type=="guardian.validation.objective" 
and guardian.id=="vu9U3hXa3q0AAAABADFhcHA6ZHluYXRyYWNlLnNpdGUucmVsaWFiaWxpdHkuZ3VhcmRpYW46Z3VhcmRpYW5zAAZ0ZW5hbnQABnRlbmFudAAkYmZiMGQ3NjktNzQyMS0zOTdmLWIyYjItMDEzZmE5ZjI1NmYxvu9U3hXa3q0"
and objective.status=="fail"
and matchesPhrase(objective.name,"My Objective")

```

And provide data for the Davis event you want (don’t forget to add dt.davis.timeout to set the problem duration for example).

And finally&nbsp;create a route for bizevents for SRG:

 ![Julius_Loman_0-1763551492842.png](https://global.discourse-cdn.com/dynatrace/original/2X/6/6f31fa6bb4d819f635a3bb244b7e6915318915a9.png)

SRG bizevents should be then processed by the pipeline you just created. You will need to create the pipeline just once and then you can add davis events for other SRG related objective validations, (different SRGs, objectives, etc…).

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [November 19, 2025, 11:37am UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984/15 "2025-11-19T11:37:57Z")

</div>

[@Joao1](https://community.dynatrace.com/user/63241)&nbsp;Correct, trigger the validation from a simple workflow like this, for example every 1 hour and set the timeframe for SRG to 2 hours. So every hour, the SRG will be called for timeframe of last two hours:

 ![Julius_Loman_1-1763551937837.png](https://global.discourse-cdn.com/dynatrace/original/2X/9/9fa86e9ab3681c200ce465b69d921da72d4de942.png)

In the SRG you need to create the objective on logs like this:

```markup
fetch logs
| filter matchesPhrase(content, "this message should occur")
| summarize count=count()

```

And add a condition of your choice:

 ![Julius_Loman_2-1763552264107.png](https://global.discourse-cdn.com/dynatrace/original/3X/a/c/ac512cf972047668ea1f63a87bdb5ed5db21f171.png)

---

<div class="post-metadata">

**Author:** ![Joao1](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@Joao1](https://community.dynatrace.com/u/Joao1)\
**Post date:** [November 19, 2025, 11:59am UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984/16 "2025-11-19T11:59:16Z")

</div>

Hey&nbsp;[@Julius\_Loman](https://community.dynatrace.com/user/3364)&nbsp;, i created everything as you said, but the problem is not being created.

I can see that the event is entering the pipeline as follows:

 ![Joao1_0-1763553393397.png](https://global.discourse-cdn.com/dynatrace/original/2X/6/623179e896134b148a3dc1d6da53fe4212f0c1f7.png)

As you can that graph, when it goes up it’s me executing the workflow to create the bizevent based on the guardian validation.

i have the parsing as you said inside the pipeline, and then i created in the Data Extraction the following:

event.type == “guardian.validation.finished”  
and matchesPhrase(guardian.name, “test”)  
and matchesPhrase(validation.status, “fail”)

in the properties, event.type is set as CUSTOM\_ALERT.

I have these properties though:

 ![Joao1_1-1763553535268.png](https://global.discourse-cdn.com/dynatrace/original/2X/d/d877683788cf237713bb988a740fa7e1b518c7fc.png)

Can i do that or is that the reason for the problem to not open?

Thanks in advance,

Joao

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [November 19, 2025, 12:17pm UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984/17 "2025-11-19T12:17:46Z")

</div>

[@Joao1](https://community.dynatrace.com/user/63241),&nbsp; please see the validation results in a notebook:

fetch bizevents  
| filter&nbsp;event.type == “guardian.validation.finished”

and check the data you have.

---

<div class="post-metadata">

**Author:** ![Joao1](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@Joao1](https://community.dynatrace.com/u/Joao1)\
**Post date:** [November 19, 2025, 12:32pm UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984/18 "2025-11-19T12:32:26Z")

</div>

[@Julius\_Loman](https://community.dynatrace.com/user/3364)&nbsp;,

executed the dql query as requested, i have various entries, the most recent one:

{  
“timestamp”: “2025-11-19T12:26:28.541000000Z”,  
“validation.triggered\_by.user.id”: “30683445-5db3-4298-ba95-ed1beb67c869”,  
“validation.id”: “d7c1aba1-698e-4b5c-94d6-97ee25d1e47c”,  
“event.id”: “450b6a24-acbf-48da-bd25-be573d191701”,  
“guardian.description”: “This guardian is used to validate how many events occured in a timeframe of two hours. Event is there is no events in that timeframe we want to alert.”,  
“validation.from”: “2025-11-19T10:26:28.149Z”,  
“validation.workflow.trigger\_type”: “Manual”,  
“dt.openpipeline.pipelines”: [  
“bizevents:default”  
],  
“validation.workflow.type”: “STANDARD”,  
“guardian.id”: “vu9U3hXa3q0AAAABADFhcHA6ZHluYXRyYWNlLnNpdGUucmVsaWFiaWxpdHkuZ3VhcmRpYW46Z3VhcmRpYW5zAAZ0ZW5hbnQABnRlbmFudAAkNjhhNzdhZWUtZmQwZi0zYzliLTg4YjktMDE4MGJjMGZjMjY3vu9U3hXa3q0”,  
“event.provider”: “dynatrace.site.reliability.guardian”,  
“guardian.name”: “Application Name (sss) - Event 114”,  
“validation.summary”: “{\“pass\”:0,\“warning\”:0,\“fail\”:1,\“error\”:0,\“info\”:0}”,  
“validation.errors”: “[]”,  
“guardian.variables”: “[]”,  
“dt.openpipeline.source”: “/api/v2/bizevents/ingest”,  
“event.kind”: “BIZ\_EVENT”,  
“validation.workflow.execution.id”: “d4133133-864c-447e-b6b2-100b58bd4bcc”,  
“validation.workflow.id”: “648494f6-58c1-4b33-9017-1783cf7e0f79”,  
“validation.to”: “2025-11-19T12:26:28.149Z”,  
“event.type”: “guardian.validation.finished”,  
“validation.status”: “fail”  
}

This is the DQL matcher i have in the data extraction:

event.type == “guardian.validation.finished”

and it’s not opening the problem.

event type:

![Joao1_0-1763555537587.png](https://global.discourse-cdn.com/dynatrace/original/3X/2/d/2d2127004fdf45c089aae23cadb1af55c3c8ca34.png)

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [November 19, 2025, 3:46pm UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984/19 "2025-11-19T15:46:51Z")

</div>

Looks like the event did not go to a custom pipeline:

```markup
"dt.openpipeline.pipelines": [
"bizevents:default"
],

```

I don’t see the objective fields (see DQL processor in my pipeline)

---

<div class="post-metadata">

**Author:** ![Joao1](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@Joao1](https://community.dynatrace.com/u/Joao1)\
**Post date:** [November 19, 2025, 4:40pm UTC](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984/20 "2025-11-19T16:40:23Z")

</div>

Hey&nbsp;[@Julius\_Loman](https://community.dynatrace.com/user/3364)&nbsp;, it’s fixed.

My dynamic route was wrongly configured. It had&nbsp;event.type == “guardian.validation.objective” instead of&nbsp;event.type == “guardian.validation.finished”

I fixed it and the problem opened. Thanks so much 🙂

[Next page](https://community.dynatrace.com/t/combine-maketimeseries-with-summarize-in-dql-for-advanced-analysis/53984.md?page=2)
