# How to setup alerts based on application logs?

**URL:** <https://community.influxdata.com/t/how-to-setup-alerts-based-on-application-logs/14308>\
**Category:** Systems\
**Tags:** influxdb, telegraf, kapacitor\
**Created:** [May 12, 2020, 3:00pm UTC](https://community.influxdata.com/t/how-to-setup-alerts-based-on-application-logs/14308 "2020-05-12T15:00:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dhana\_Krishnasamy](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/dhana_krishnasamy/32/4931_2.png) [@Dhana\_Krishnasamy](https://community.influxdata.com/u/Dhana_Krishnasamy)\
**Post date:** [May 12, 2020, 3:00pm UTC](https://community.influxdata.com/t/how-to-setup-alerts-based-on-application-logs/14308/1 "2020-05-12T15:00:10Z")

</div>

We are looking to replace a vendor product which can be configured to monitor log files for certain patterns like Exceptions or ERROR.  
I am trying to use influxData tools for this. I managed to setup Telegraf to gork the log file and feed them to influx db. I could see that log data to an extent in Grafana and plot a graph as well. However I cannot use Prometheus for alerts as it doesn’t fit in our security requirements. I am looking at Kapacitor and Chronograf however I dont see how can I use string data to setup alerts in Kapacitor/Chronograf.  
Has anyone done this before? Any inputs will be greatly appriciated.

Thanks

---

<div class="post-metadata">

**Author:** ![Dhana\_Krishnasamy](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/dhana_krishnasamy/32/4931_2.png) [@Dhana\_Krishnasamy](https://community.influxdata.com/u/Dhana_Krishnasamy)\
**Post date:** [May 13, 2020, 8:10am UTC](https://community.influxdata.com/t/how-to-setup-alerts-based-on-application-logs/14308/2 "2020-05-13T08:10:11Z")

</div>

It looks like I have to write TICK script something like this

```
stream
    |from()
        .measurement('sample_log')
    |alert()
        .crit(lambda: string("severity") == 'ERROR')
        .log('/tmp/alerts.log')
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/3X/2/f/2feb065bdfd5e4b7728243aa3b9192ad3e8447c1.png) [@system](https://community.influxdata.com/u/system)\
**Post date:** [May 13, 2020, 9:10am UTC](https://community.influxdata.com/t/how-to-setup-alerts-based-on-application-logs/14308/3 "2020-05-13T09:10:19Z")

</div>

Closed on May 13, 2020, 9:10am UTC

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