# Can a log metric be used in an alert like this?

**URL:** <https://community.dynatrace.com/t/can-a-log-metric-be-used-in-an-alert-like-this/31406>\
**Category:** Alerting\
**Tags:** problem-detection, problem-notification, problems-classic\
**Created:** [May 7, 2021, 6:50pm UTC](https://community.dynatrace.com/t/can-a-log-metric-be-used-in-an-alert-like-this/31406 "2021-05-07T18:50:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brynatrace](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@Brynatrace](https://community.dynatrace.com/u/Brynatrace)\
**Post date:** [May 7, 2021, 6:50pm UTC](https://community.dynatrace.com/t/can-a-log-metric-be-used-in-an-alert-like-this/31406/1 "2021-05-07T18:50:30Z")

</div>

I’ve got a log file that every so often writes the duration of a script down:

[Friday, May 7, 2021 5:31:07 PM]&nbsp;Run started…  
[Friday, May 7, 2021 6:32:28 PM]&nbsp;Run completed  
[Friday, May 7, 2021 6:32:28 PM] Total runtime: 61.21 Minutes  
[Friday, May 7, 2021 6:36:07 PM]&nbsp;Run started…  
&nbsp;  
My metric captures the 61.21 as a Number called RunMinutes and that seems to work great for charting.  
This log exists for many process groups.

What I want to do is monitor for RunMinutes greater than 45 and trigger a Slowdown alert, and if the log hasn’t been written to in an hour, trigger an (error, availability?) Alert.

From the Create Custom Event for Alerting, when I select my RunMinutes Metric, the option by “Alert anomalies with a static threshold of” only has “Count” in the dropdown.&nbsp; If I put 45 in there, am I telling it 45 new instances of RunMinutes, instead of a RunMinutes value of greater than 45?

And on the next bit, if I set the observation period to 60 minutes - where we can Alert if the data is missing for 60 minutes - if one of my logs that gives me RunMinutes is hung up, but the others are still putting in RunMinutes - while I not see an alarm, do I need to do I need to create a single custom event for each log to get an alert when one’s hung up?

Thanks,

B

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [May 10, 2021, 12:39pm UTC](https://community.dynatrace.com/t/can-a-log-metric-be-used-in-an-alert-like-this/31406/2 "2021-05-10T12:39:37Z")

</div>

As long as the data exists/shows up in the log file, then yes you can alert on it. You have multiple methods to alert on it. You can create a problem on it, create an event for it an so on. Id give it a shot especially if you need to be alerted when the entry shows up in the log.
