# Need help on elastalert configuration

**URL:** <https://discuss.elastic.co/t/need-help-on-elastalert-configuration/50200>\
**Category:** Elasticsearch\
**Created:** [May 17, 2016, 9:02am UTC](https://discuss.elastic.co/t/need-help-on-elastalert-configuration/50200 "2016-05-17T09:02:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vmankala](https://avatars.discourse-cdn.com/v4/letter/v/96bed5/32.png) [@vmankala](https://discuss.elastic.co/u/vmankala)\
**Post date:** [May 17, 2016, 9:02am UTC](https://discuss.elastic.co/t/need-help-on-elastalert-configuration/50200/1 "2016-05-17T09:02:17Z")

</div>

I have setup an ELK such as installed filebeat on target hosts and configured 1 centralised logstash server. Created an Elastic search domain and given the domain url in logstash conf file. Also I have setup an Elastalert in same logstash server to send me mail when certain error text is matched. Below is elastalert conf file

* * *

# (Required)

# Index to search, wildcard supported

index: logstash-\*

# (Required, frequency specific)

# Alert when this many documents matching the query occur within a timeframe

num\_events: 1

# (Required, frequency specific)

# num\_events must occur within this amount of time to trigger an alert

timeframe:  
hours: 4

# A list of elasticsearch filters used for find events

# These filters are joined with AND and nested in a filtered query

# For more info: [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html)

alert\_text\_type: alert\_text\_only

filter:

- query:  
query\_string:  
query: "Invalid Password"

# (Required)

# The alert is use when a match is found

alert:

- "email"

alert\_text: |  
ElastAlert has detected suspicious activity for {0}.  
At {1}, an {2} error occured under {3} path. {4}. Do something about it!

alert\_text\_args:

- email
- host
- type
- source
- message

# (required, email specific)

# a list of email addresses to send alerts to

email:

- "vmankala@ctepl.com"

* * *

the issue is the email I am getting has other irrelevant info in it. Below is email

* * *

# (Required)

# Index to search, wildcard supported

index: logstash-\*

# (Required, frequency specific)

# Alert when this many documents matching the query occur within a timeframe

num\_events: 1

# (Required, frequency specific)

# num\_events must occur within this amount of time to trigger an alert

timeframe:  
hours: 4

# A list of elasticsearch filters used for find events

# These filters are joined with AND and nested in a filtered query

# For more info: [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html)

alert\_text\_type: alert\_text\_only

filter:

- query:  
query\_string:  
query: "Invalid Password"

# (Required)

# The alert is use when a match is found

alert:

- "email"

alert\_text: |  
ElastAlert has detected suspicious activity for {0}.  
At {1}, an {2} error occured under {3} path. {4}. Do something about it!

alert\_text\_args:

- email
- host
- type
- source
- message

# (required, email specific)

# a list of email addresses to send alerts to

email:

- "vmankala@ctepl.com"
- "mgaddam@ctepl.com"

* * *

Please let me know how would I remove the irrelevant data from mail.

---

<div class="post-metadata">

**Author:** ![shanec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shanec/32/4004_2.png) [@shanec](https://discuss.elastic.co/u/shanec)\
**Post date:** [May 17, 2016, 11:03am UTC](https://discuss.elastic.co/t/need-help-on-elastalert-configuration/50200/2 "2016-05-17T11:03:04Z")

</div>

You may need to ask the elastalert authors directly. I don't believe they hang out on these forums

---

<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:** [July 5, 2017, 10:51pm UTC](https://discuss.elastic.co/t/need-help-on-elastalert-configuration/50200/3 "2017-07-05T22:51:12Z")

</div>


