# Alert on logs error

**URL:** <https://discuss.elastic.co/t/alert-on-logs-error/285772>\
**Category:** Kibana\
**Created:** [October 3, 2021, 6:33pm UTC](https://discuss.elastic.co/t/alert-on-logs-error/285772 "2021-10-03T18:33:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![alfredo.deluca](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alfredo.deluca/32/95381_2.png) [@alfredo.deluca](https://discuss.elastic.co/u/alfredo.deluca)\
**Post date:** [October 3, 2021, 6:33pm UTC](https://discuss.elastic.co/t/alert-on-logs-error/285772/1 "2021-10-03T18:33:29Z")

</div>

Hi all.  
I have scripts that run every night to back up gitlab and and at the end it logs a file with the result of that backup.  
The logs are sent to our Elastic cloud account and from there I want to create an alert when that log has an error about the backup  
How can I do that? the back up log is in a json format too.

Cheers

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [October 3, 2021, 7:24pm UTC](https://discuss.elastic.co/t/alert-on-logs-error/285772/2 "2021-10-03T19:24:37Z")

</div>

You can rely on Kibana Alerting [Alerting | Kibana Guide [7.15] | Elastic](https://www.elastic.co/guide/en/kibana/current/alerting-getting-started.html)

---

<div class="post-metadata">

**Author:** ![alfredo.deluca](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alfredo.deluca/32/95381_2.png) [@alfredo.deluca](https://discuss.elastic.co/u/alfredo.deluca)\
**Post date:** [October 3, 2021, 8:12pm UTC](https://discuss.elastic.co/t/alert-on-logs-error/285772/3 "2021-10-03T20:12:42Z")

</div>

Thanks Yassine for the info.  
The problem is I am not sure how to make the query properly, and selecting the right file onto the query.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [October 3, 2021, 9:00pm UTC](https://discuss.elastic.co/t/alert-on-logs-error/285772/4 "2021-10-03T21:00:12Z")

</div>

@alfredo.deluca

The best way for us to help is show us some sample documents log looks like

What is a positive completed result and what is a negative / error result.

---

<div class="post-metadata">

**Author:** ![alfredo.deluca](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alfredo.deluca/32/95381_2.png) [@alfredo.deluca](https://discuss.elastic.co/u/alfredo.deluca)\
**Post date:** [October 4, 2021, 1:36pm UTC](https://discuss.elastic.co/t/alert-on-logs-error/285772/5 "2021-10-04T13:36:34Z")

</div>

Thanks Stephen. I will do that asap

Cheers

---

<div class="post-metadata">

**Author:** ![alfredo.deluca](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alfredo.deluca/32/95381_2.png) [@alfredo.deluca](https://discuss.elastic.co/u/alfredo.deluca)\
**Post date:** [October 4, 2021, 7:37pm UTC](https://discuss.elastic.co/t/alert-on-logs-error/285772/6 "2021-10-04T19:37:39Z")

</div>

Hi Stephen.  
Here is an example of the log

{"timestamp" : "2021-09-26T16:08:50.000Z", "message": "backup failed", "status": "FAILED", "uuid": "fd574e4c-b10d-44fb-b92a-3fe7904885b6", "node": "node1"}

The file is called backup.log and I want to check the status FAILED then send an alert.

Cheers

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [October 4, 2021, 7:44pm UTC](https://discuss.elastic.co/t/alert-on-logs-error/285772/7 "2021-10-04T19:44:32Z")

</div>

I would probably start with the Log Threshold Rule... and check for

`WITH status IS FAILED` as your condition

`IS more than 1`

etc

> **[Create a logs threshold rule | Observability Guide \[7.15\] | Elastic](https://www.elastic.co/guide/en/observability/current/logs-threshold-alert.html)**

---

<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:** [November 1, 2021, 7:45pm UTC](https://discuss.elastic.co/t/alert-on-logs-error/285772/8 "2021-11-01T19:45:32Z")

</div>

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