# create an alert from log data

**URL:** <https://community.dynatrace.com/t/create-an-alert-from-log-data/43085>\
**Category:** Alerting\
**Tags:** anomaly-detection, problems-classic\
**Created:** [December 7, 2023, 4:44pm UTC](https://community.dynatrace.com/t/create-an-alert-from-log-data/43085 "2023-12-07T16:44:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sushree](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@sushree](https://community.dynatrace.com/u/sushree)\
**Post date:** [December 7, 2023, 4:44pm UTC](https://community.dynatrace.com/t/create-an-alert-from-log-data/43085/1 "2023-12-07T16:44:45Z")

</div>

we have the datalogs on-boarded into grail , I want to create an alert using the logs fields value . I have created a processing rule and extracted 2 fields-

---&nbsp; expiration days

----- Healthstate

so i want to create an alert for the healthstate = false , whenever it comes false , an alert should have been triggered .

so after creating processing rule what should be the steps to create an alert , Please let me know .

---

<div class="post-metadata">

**Author:** ![LukeHearth](https://avatars.discourse-cdn.com/v4/letter/l/41988e/32.png) [@LukeHearth](https://community.dynatrace.com/u/LukeHearth)\
**Post date:** [January 3, 2024, 4:15pm UTC](https://community.dynatrace.com/t/create-an-alert-from-log-data/43085/2 "2024-01-03T16:15:51Z")

</div>

Hello&nbsp;[@sushree](https://community.dynatrace.com/user/69643)&nbsp;,

You may not need to extract the value at all you can use a DQL Matcher in the Log Monitoing \> Metrics Extraction ro look for the content where the health state is equal to false and count the number of times that this condition appears below is an example:

 ![luke_hearth_0-1704298527274.png](https://global.discourse-cdn.com/dynatrace/original/3X/2/5/257033bfc9698294f023f68ac18f8be239ad56d2.png)

You can then using the example above create a metric event / custom problem based off of that , that sends an alert when the metric at any point in time is above 0.

Let me know if i need to explain this in a better way. I hope this helps.

Yours,

luke Hearth

---

<div class="post-metadata">

**Author:** ![guoguoyun](https://avatars.discourse-cdn.com/v4/letter/g/df705f/32.png) [@guoguoyun](https://community.dynatrace.com/u/guoguoyun)\
**Post date:** [January 30, 2024, 7:54am UTC](https://community.dynatrace.com/t/create-an-alert-from-log-data/43085/3 "2024-01-30T07:54:03Z")

</div>

Hi@LukeHearth, i had added the log metric&nbsp; ,and&nbsp;I was preparing to put the metrics into the metrics event, but this error occurred in the configuration.([Log metrics — Dynatrace Docs](https://docs.dynatrace.com/docs/observe-and-explore/logs/lma-analysis/lma-log-metrics)).  
Btw,&nbsp;If I want to configure an alarm so that the alarm channel goes to slack, what should I do next?

 ![guoguoyun_2-1706601151430.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/d/ed75c50ef44c0070f0be760e4fe5e0346e5af4ef.png)

---

<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:** [January 30, 2024, 7:56am UTC](https://community.dynatrace.com/t/create-an-alert-from-log-data/43085/4 "2024-01-30T07:56:34Z")

</div>

Use the dataexplorer to query the metric.  
Change to avanced mode.  
Copy the metric selector  
In the metric event change from Metric Key to metric selector.  
Use the previous metric selector.

---

<div class="post-metadata">

**Author:** ![guoguoyun](https://avatars.discourse-cdn.com/v4/letter/g/df705f/32.png) [@guoguoyun](https://community.dynatrace.com/u/guoguoyun)\
**Post date:** [January 31, 2024, 2:36am UTC](https://community.dynatrace.com/t/create-an-alert-from-log-data/43085/5 "2024-01-31T02:36:28Z")

</div>

It was a useful help, solved ，thanks
