# Alert based on content of message

**URL:** https://discuss.elastic.co/t/alert-based-on-content-of-message/144368
**Category:** Elasticsearch
**Created:** [August 14, 2018, 4:12pm UTC](https://discuss.elastic.co/t/alert-based-on-content-of-message/144368 "2018-08-14T16:12:03Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Magnus\_Therning](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnus_therning/32/33091_2.png) [@Magnus\_Therning](https://discuss.elastic.co/u/Magnus_Therning)
#### Post date: [August 14, 2018, 4:12pm UTC](https://discuss.elastic.co/t/alert-based-on-content-of-message/144368/1 "2018-08-14T16:12:03Z")

</div>

I'd like to be alerted as soon as a message containing the string _"ERROR"_ is logged in our production system. The corresponding Kibana search would be `fields.env:production AND message:ERROR`.

Based on what I've found online this should be possible to achieve, but I just can't figure out exactly how in the UI. Any and all help would be much appreciated.

I'm using version 6.2.4 hosted by [cloud.elastic.co](http://cloud.elastic.co).

---

<div class="post-metadata">

### Author: ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)
#### Post date: [August 14, 2018, 8:54pm UTC](https://discuss.elastic.co/t/alert-based-on-content-of-message/144368/2 "2018-08-14T20:54:17Z")

</div>

Take a look at this [https://github.com/elastic/examples/tree/master/Alerting/Sample%20Watches/errors\_in\_logs](https://github.com/elastic/examples/tree/master/Alerting/Sample%20Watches/errors_in_logs)

It should be enough to get you started.

---

<div class="post-metadata">

### Author: ![Magnus\_Therning](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnus_therning/32/33091_2.png) [@Magnus\_Therning](https://discuss.elastic.co/u/Magnus_Therning)
#### Post date: [August 15, 2018, 9:02am UTC](https://discuss.elastic.co/t/alert-based-on-content-of-message/144368/3 "2018-08-15T09:02:35Z")

</div>

Thanks, that didn't only get me started, it got me across the finish line 😃

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 12, 2018, 9:02am UTC](https://discuss.elastic.co/t/alert-based-on-content-of-message/144368/4 "2018-09-12T09:02:36Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
