# Custom alerts for log monitoring

**URL:** <https://community.dynatrace.com/t/custom-alerts-for-log-monitoring/37460>\
**Category:** Alerting\
**Tags:** log-monitoring-class, problems-classic\
**Created:** [November 25, 2022, 3:42am UTC](https://community.dynatrace.com/t/custom-alerts-for-log-monitoring/37460 "2022-11-25T03:42:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jc\_1](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@jc\_1](https://community.dynatrace.com/u/jc_1)\
**Post date:** [November 25, 2022, 3:42am UTC](https://community.dynatrace.com/t/custom-alerts-for-log-monitoring/37460/1 "2022-11-25T03:42:39Z")

</div>

Hi

I would like to create a custom alert on log monitoring whereby an alert is raised when more than 1 log events occurred in a day. I tried to configure the custom event to raise an error when the metric threshold is above 1 in the given day, which is 1440 minutes. However, the maximum value of minutes period is 60. Can anyone advise me on this issue?

 ![jc___0-1669347452192.png](https://global.discourse-cdn.com/dynatrace/original/1X/5a18f45380c15a3a1cb9fa0862c50c9c1fe2ab83.jpeg)

Thank you.

---

<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:** [November 25, 2022, 1:16pm UTC](https://community.dynatrace.com/t/custom-alerts-for-log-monitoring/37460/2 "2022-11-25T13:16:51Z")

</div>

Correct me if I am wrong, but if you get an alert in 1h, it means that you got an alert that day, and you will need to be notified about it.

The only problem with the 1h instead 24h is that you may end up receiving more than one alert per day, which may indicates that the system you are monitoring is not so healthy and the attention is required.

You can also work with metrics transformation, for example, limiting the data points to the last day with :timeshift(-1d) and then combine the data to a single point with :fold.

Example:

your.custom.metric.for.log:timeshift(-1d):fold

Try and let us know.

---

<div class="post-metadata">

**Author:** ![jc\_1](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@jc\_1](https://community.dynatrace.com/u/jc_1)\
**Post date:** [November 29, 2022, 8:52am UTC](https://community.dynatrace.com/t/custom-alerts-for-log-monitoring/37460/3 "2022-11-29T08:52:19Z")

</div>

Hi dannemca ,

Thank you for responding.

I might not have make myself clear in the question asked.

**The requirement:**

_Raise an alert if the metric is above the static threshold of 1 in 2 one minute slot during a day (24 hrs)_

**The scenario:**

_Our client has a server that will restart once everyday, hence, one “initialized” keyword will be observed in the log. If there is more than 1 “initialized” keyword raised in a day, an alert should be raised so that our client can look into the issue._

May I know if there is any way to achieve the above requirement?

Thank you.

---

<div class="post-metadata">

**Author:** ![MichalGebacki](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michalgebacki/32/41585_2.png) [@MichalGebacki](https://community.dynatrace.com/u/MichalGebacki)\
**Post date:** [December 22, 2022, 4:13pm UTC](https://community.dynatrace.com/t/custom-alerts-for-log-monitoring/37460/4 "2022-12-22T16:13:45Z")

</div>

Hi&nbsp;[@dannemca](https://community.dynatrace.com/user/18264)! Do you know if that alerting requirement that jc\_ mentioned above is actually possible to achieve? Thank you for your help in advance!

---

<div class="post-metadata">

**Author:** ![Tom\_Eaton](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/tom_eaton/32/27852_2.png) [@Tom\_Eaton](https://community.dynatrace.com/u/Tom_Eaton)\
**Post date:** [March 31, 2023, 12:47pm UTC](https://community.dynatrace.com/t/custom-alerts-for-log-monitoring/37460/5 "2023-03-31T12:47:18Z")

</div>

You could look into a possible similar solution as I have seen once before:

1. Create a log metric to find the log messages with '_initialized’ - use matchesPhrase_

2. Then create an SLO using a metric selector with the defualt(0,always) for your log metric - this will give every 1 minute sample a 0 default value when data is missing.

---

<div class="post-metadata">

**Author:** ![Tom\_Eaton](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/tom_eaton/32/27852_2.png) [@Tom\_Eaton](https://community.dynatrace.com/u/Tom_Eaton)\
**Post date:** [March 31, 2023, 12:52pm UTC](https://community.dynatrace.com/t/custom-alerts-for-log-monitoring/37460/6 "2023-03-31T12:52:06Z")

</div>

[@dannemca](https://community.dynatrace.com/user/18264)&nbsp;- the timeshift only moves the time, it is used as a timeframe window. So -1d will not give the last 24 hours, but just make the current date and time, 1 day before.. I.E 31st March becomes 30th March
