# Create a Dynatrace problem using log data everytime it reaches 10 hits in 24h

**URL:** <https://community.dynatrace.com/t/create-a-dynatrace-problem-using-log-data-everytime-it-reaches-10-hits-in-24h/52916>\
**Category:** DQL\
**Tags:** dql, dynatrace-managed, logs\
**Created:** [August 12, 2025, 1:44pm UTC](https://community.dynatrace.com/t/create-a-dynatrace-problem-using-log-data-everytime-it-reaches-10-hits-in-24h/52916 "2025-08-12T13:44:17Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Puche](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/puche/32/612_2.png) [@Puche](https://community.dynatrace.com/u/Puche)\
**Post date:** [August 12, 2025, 1:44pm UTC](https://community.dynatrace.com/t/create-a-dynatrace-problem-using-log-data-everytime-it-reaches-10-hits-in-24h/52916/1 "2025-08-12T13:44:17Z")

</div>

Hello, community!!

We need to create a problem everytime a log on Grail value is \>= to setup number. We have been able to create the graphical representation in DQL:

_fetch logs, from: -24h, scanLimitGBytes:1, samplingRatio:1_  
_| filter matchesValue(content, “\*ranchdressing\*”) AND (offset1 \>= “0.005” or offset2 \>= “0.005”)_

But with traditional Metric Events we can only go up to 60 minutes (_after converting the DQL into a metric_)

Another problem is to convert the DQL above into a metric, with Openpipeline it won’t accept the DQL as it is. We have tried several combinations, but we end up having to take the \>= of in orther to get something, which is not useful.

With workflows we have the same problem, as we would need to convert, first, the DQL into an event.

Any ideas?

Thanks

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [August 12, 2025, 7:00pm UTC](https://community.dynatrace.com/t/create-a-dynatrace-problem-using-log-data-everytime-it-reaches-10-hits-in-24h/52916/2 "2025-08-12T19:00:09Z")

</div>

Have you tried to set up the Davis Anomaly Detection for that?

> **[Create log alerts for a log event or summary of log data](https://docs.dynatrace.com/docs/dynatrace-intelligence/use-cases/create-alert-in-logs)**
>
> Create log alerts for a specific log event or summary of log data

Wondering if the 24h as timeframe will be a problem here.

---

<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:** [August 12, 2025, 8:07pm UTC](https://community.dynatrace.com/t/create-a-dynatrace-problem-using-log-data-everytime-it-reaches-10-hits-in-24h/52916/3 "2025-08-12T20:07:45Z")

</div>

[@dannemca](https://community.dynatrace.com/user/18264)&nbsp;and&nbsp;[@Puche](https://community.dynatrace.com/user/43982)&nbsp;, I believe the best approach here is using Site Reliability Guardian for that. You need to setup

- a SRG which checks the logs
- a simple workflow to trigger the SRG every 24 hours (or every hour based on your preference)
- create an openpipeline for your SRG and have a data extraction rule in openpipeline for davis event to open a problem when SRG results are failed

This approach is effective and works well for evaluating any data, not just logs.

---

<div class="post-metadata">

**Author:** ![mizso74](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mizso74/32/41729_2.png) [@mizso74](https://community.dynatrace.com/u/mizso74)\
**Post date:** [August 12, 2025, 9:07pm UTC](https://community.dynatrace.com/t/create-a-dynatrace-problem-using-log-data-everytime-it-reaches-10-hits-in-24h/52916/4 "2025-08-12T21:07:58Z")

</div>

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

Very nice solution!!! Thanks for sharing it!!!

Best regards,

János

---

<div class="post-metadata">

**Author:** ![Puche](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/puche/32/612_2.png) [@Puche](https://community.dynatrace.com/u/Puche)\
**Post date:** [August 13, 2025, 7:49am UTC](https://community.dynatrace.com/t/create-a-dynatrace-problem-using-log-data-everytime-it-reaches-10-hits-in-24h/52916/5 "2025-08-13T07:49:47Z")

</div>

Hello!

[@Julius\_Loman](https://community.dynatrace.com/user/3364),&nbsp;thanks for your answer but the same DQL that works with Dashboard or workflow, doesn’t work with SRG.

 ![Puche_0-1755071270300.png](https://global.discourse-cdn.com/dynatrace/original/3X/f/e/fe144d457b56d83406225c4af00895769980e82d.png)

This is a handicap, we need to redo queries, instead of copy and paste.

Any ideas?

Thanks

---

<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:** [August 13, 2025, 10:14am UTC](https://community.dynatrace.com/t/create-a-dynatrace-problem-using-log-data-everytime-it-reaches-10-hits-in-24h/52916/6 "2025-08-13T10:14:40Z")

</div>

What do you want to evaluate? Count of such logs? In that case you just need to add summarize to your query.

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [August 13, 2025, 12:19pm UTC](https://community.dynatrace.com/t/create-a-dynatrace-problem-using-log-data-everytime-it-reaches-10-hits-in-24h/52916/7 "2025-08-13T12:19:21Z")

</div>

Indeed a Dynatrace Master!!!&nbsp;:man\_teacher:

---

<div class="post-metadata">

**Author:** ![Puche](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/puche/32/612_2.png) [@Puche](https://community.dynatrace.com/u/Puche)\
**Post date:** [August 13, 2025, 12:31pm UTC](https://community.dynatrace.com/t/create-a-dynatrace-problem-using-log-data-everytime-it-reaches-10-hits-in-24h/52916/8 "2025-08-13T12:31:48Z")

</div>

Yes, counts of such logs, but only for values that are \>= than 0.005 on either of two variable (offsets). And that every time it reaches 10 over 24h it creates a problem.

We were expecting that if a DQL query works for a Dashboard or a workflow, it should work for other DQL request such as SRG, log metric extraction or Openpipeline.

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

---

<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:** [August 13, 2025, 12:55pm UTC](https://community.dynatrace.com/t/create-a-dynatrace-problem-using-log-data-everytime-it-reaches-10-hits-in-24h/52916/9 "2025-08-13T12:55:17Z")

</div>

[@Puche](https://community.dynatrace.com/user/43982)&nbsp; yes it works, but for SRG needs a value - just like a metric. You can also do that by creating a log metric and evaluating that.

In your case you probably want:

```markup
fetch logs
| filter matchesValue(content, "*ranchdressing*") AND (offset1 >= "0.005" or offset2 >= "0.005")
| summarize count()

```

This will output just a single number of log lines with the conditions above. I also removed the from, sampling, etc. as it will be handled by SRG.

---

<div class="post-metadata">

**Author:** ![Puche](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/puche/32/612_2.png) [@Puche](https://community.dynatrace.com/u/Puche)\
**Post date:** [August 13, 2025, 2:05pm UTC](https://community.dynatrace.com/t/create-a-dynatrace-problem-using-log-data-everytime-it-reaches-10-hits-in-24h/52916/10 "2025-08-13T14:05:09Z")

</div>

Thank you very much, that works now to create the SRG. I’ll keep on working on your other tips and I’ll let you know the results.

---

<div class="post-metadata">

**Author:** ![Puche](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/puche/32/612_2.png) [@Puche](https://community.dynatrace.com/u/Puche)\
**Post date:** [August 18, 2025, 10:55am UTC](https://community.dynatrace.com/t/create-a-dynatrace-problem-using-log-data-everytime-it-reaches-10-hits-in-24h/52916/11 "2025-08-18T10:55:46Z")

</div>

The workflow with the SRG has worked and fulfilled the needs of the petitions.

But some other doubts have come across during this process.

Why is necessary to create an SRG for the workflow instead of just using and execution of a DQL?

And another question is How can you use the SRG to create a pipeline in Openpipeline, as you mention in step 3?

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

---

<div class="post-metadata">

**Author:** ![PacoPorro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pacoporro/32/36087_2.png) [@PacoPorro](https://community.dynatrace.com/u/PacoPorro)\
**Post date:** [August 18, 2025, 12:29pm UTC](https://community.dynatrace.com/t/create-a-dynatrace-problem-using-log-data-everytime-it-reaches-10-hits-in-24h/52916/12 "2025-08-18T12:29:34Z")

</div>

summarize count to provide a single value

---

<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:** [August 18, 2025, 1:20pm UTC](https://community.dynatrace.com/t/create-a-dynatrace-problem-using-log-data-everytime-it-reaches-10-hits-in-24h/52916/13 "2025-08-18T13:20:58Z")

</div>

[@Puche](https://community.dynatrace.com/user/43982), sure, it’s possible to do that using workflow only. But workflows are, from my experience, too costly for that (260$/year for a single workflow in list prices) and they don’t leave much historical track record for evaluations. I believe SRG is the way to do it.

SRG sends bizevents with the results and evaluations. You create an OpenPipeline pipepile for those bizevents, and there you can create a Davis event - essentially triggering a problem opening event.

---

<div class="post-metadata">

**Author:** ![Puche](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/puche/32/612_2.png) [@Puche](https://community.dynatrace.com/u/Puche)\
**Post date:** [August 19, 2025, 11:03am UTC](https://community.dynatrace.com/t/create-a-dynatrace-problem-using-log-data-everytime-it-reaches-10-hits-in-24h/52916/14 "2025-08-19T11:03:31Z")

</div>

Thank you for your help.

Best regards
