# Send email alerts based on specific string in logs

**URL:** <https://community.dynatrace.com/t/send-email-alerts-based-on-specific-string-in-logs/45844>\
**Category:** Alerting\
**Tags:** problems-classic, logs\
**Created:** [May 30, 2024, 9:40pm UTC](https://community.dynatrace.com/t/send-email-alerts-based-on-specific-string-in-logs/45844 "2024-05-30T21:40:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZackE](https://avatars.discourse-cdn.com/v4/letter/z/9fc29f/32.png) [@ZackE](https://community.dynatrace.com/u/ZackE)\
**Post date:** [May 30, 2024, 9:40pm UTC](https://community.dynatrace.com/t/send-email-alerts-based-on-specific-string-in-logs/45844/1 "2024-05-30T21:40:06Z")

</div>

Hi, new to Dynatrace here.

I’ve been asked to set up email alerts for a certain situation. If logs from any of three specific hosts contain “Invalid username or password.” in their content field, an alert email should be sent to a specific address.

How would I go about that? We use Grail.

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [May 31, 2024, 7:05am UTC](https://community.dynatrace.com/t/send-email-alerts-based-on-specific-string-in-logs/45844/2 "2024-05-31T07:05:40Z")

</div>

Hi,

You need:

- Create a [log event](https://docs.dynatrace.com/docs/shortlink/lma-log-events).
- Be sure is matching desired&nbsp;[alerting profile](https://docs.dynatrace.com/docs/shortlink/alerting-profiles).
- Create problem notification by [email](https://docs.dynatrace.com/docs/shortlink/email-notifications).

Best regards

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [May 31, 2024, 10:03am UTC](https://community.dynatrace.com/t/send-email-alerts-based-on-specific-string-in-logs/45844/3 "2024-05-31T10:03:10Z")

</div>

[@ZackE](https://community.dynatrace.com/user/76549),

In standard Dynatrace, you will have to raise a problem, to get something sent by email, as [@AntonPineiro](https://community.dynatrace.com/user/58682) said. In this case, you will probably want to use a low timeout for the event, with the dt.event.timeout, or else you might have a huge amount of problems in your environment, as the default timeout is 15 minutes.

Other ways of doing the same thing involves integrating your ITSM solution with events (eg. ServiceNow ITOM) and then sending the emails from there. Or also having an integration at the event level; in this case, we have an extension that looks at the events and sends them to several channels, including emails. You could almost certainly do it with Workflows, but I haven’t tested this yet. In all these cases, you won’t have "“Invalid username or password.” as problems in Dynatrace.

---

<div class="post-metadata">

**Author:** ![ZackE](https://avatars.discourse-cdn.com/v4/letter/z/9fc29f/32.png) [@ZackE](https://community.dynatrace.com/u/ZackE)\
**Post date:** [May 31, 2024, 9:25pm UTC](https://community.dynatrace.com/t/send-email-alerts-based-on-specific-string-in-logs/45844/4 "2024-05-31T21:25:30Z")

</div>

One of the requirements I forgot to mention was that it needs to run once every hour. So I ended up using the workflows from your suggestion, which works very well and is easy to use.
