# ALERT TRIGGERING FOR EVERY 30MINUTES

**URL:** <https://discuss.elastic.co/t/alert-triggering-for-every-30minutes/180318>\
**Category:** Logstash\
**Created:** [May 9, 2019, 9:06am UTC](https://discuss.elastic.co/t/alert-triggering-for-every-30minutes/180318 "2019-05-09T09:06:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashok2](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@Ashok2](https://discuss.elastic.co/u/Ashok2)\
**Post date:** [May 9, 2019, 9:06am UTC](https://discuss.elastic.co/t/alert-triggering-for-every-30minutes/180318/1 "2019-05-09T09:06:23Z")

</div>

Hi,

I have the logstash config file in which i have written the mail alert for particular text present then automatically send an email with the message but i keep on receiving lots of mail continuously.

I need to have an alert generated every 30min ,please help me to solve the issue  
output{  
if[type] == "mq"  
{  
elasticsearch {  
# Index name is used to store the elasticsearch value and it will display the elasticsearch value in kibana using the index name  
index =\> "logstash-dd.mq\_log"  
hosts =\> ["11.11.11.122:0000"]   
document\_id =\> "%{fingerprint}"  
}  
}

```
if[q_manager] == "ESBPRT1"
{
if[error_code] == "AMQ9616"
		{
		
		email{
				  to => "domain@gmail.com"
				  from => "123@gmail.com"
				  subject => "MQ Alert - AMQ9616"
				  body => "Hello Team,\n\n Error code AMQ9616 occured @ %{event_timestamp} .Please check and take necessary action. \n \n Link to ELM DashBoard : http://123.gmail.com \n\n\n * This is an automated e-mail and any responses to this e-mail will not be monitored \n Thank You!"
				  port => 25	
				}
		}

      }
}
```

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 9, 2019, 1:42pm UTC](https://discuss.elastic.co/t/alert-triggering-for-every-30minutes/180318/2 "2019-05-09T13:42:38Z")

</div>

I [answered](https://discuss.elastic.co/t/log-monitoring/180143/2) this question when you posted it yesterday. Which part of the answer did you have a question about?

---

<div class="post-metadata">

**Author:** ![Ashok2](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@Ashok2](https://discuss.elastic.co/u/Ashok2)\
**Post date:** [May 10, 2019, 6:19am UTC](https://discuss.elastic.co/t/alert-triggering-for-every-30minutes/180318/3 "2019-05-10T06:19:49Z")

</div>

can you help me where to write the code to trigger the mail for every 30 minutes

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 10, 2019, 2:44pm UTC](https://discuss.elastic.co/t/alert-triggering-for-every-30minutes/180318/4 "2019-05-10T14:44:50Z")

</div>

I do not run elasticsearch so I cannot help further.

---

<div class="post-metadata">

**Author:** ![Jasonespo](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@Jasonespo](https://discuss.elastic.co/u/Jasonespo)\
**Post date:** [May 10, 2019, 3:07pm UTC](https://discuss.elastic.co/t/alert-triggering-for-every-30minutes/180318/5 "2019-05-10T15:07:04Z")

</div>

Do you have x-pack watchers available to you?

You can create a watcher that will be able to send you an email every time the error\_code = "AMQ9616"

I will be able to help you if you explain a bit more about what your setup is

---

<div class="post-metadata">

**Author:** ![Ashok2](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@Ashok2](https://discuss.elastic.co/u/Ashok2)\
**Post date:** [May 13, 2019, 6:42am UTC](https://discuss.elastic.co/t/alert-triggering-for-every-30minutes/180318/6 "2019-05-13T06:42:25Z")

</div>

I don't have x-pack watchers available currently we are using 5.6.2 version

---

<div class="post-metadata">

**Author:** ![Jasonespo](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@Jasonespo](https://discuss.elastic.co/u/Jasonespo)\
**Post date:** [May 13, 2019, 6:56am UTC](https://discuss.elastic.co/t/alert-triggering-for-every-30minutes/180318/7 "2019-05-13T06:56:11Z")

</div>

Install x-pack

[https://www.elastic.co/guide/en/x-pack/5.6/installing-xpack.html](https://www.elastic.co/guide/en/x-pack/5.6/installing-xpack.html)

Once you have installed x-pack we can write a watcher for you that will fix your issue.

X-pack watchers are a useful feature that is definitely worth taking a look at even if you don't want to do it this way

---

<div class="post-metadata">

**Author:** ![Ashok2](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@Ashok2](https://discuss.elastic.co/u/Ashok2)\
**Post date:** [May 13, 2019, 7:25am UTC](https://discuss.elastic.co/t/alert-triggering-for-every-30minutes/180318/8 "2019-05-13T07:25:59Z")

</div>

Thank You Jasonespo.

I will let you know once i installed x-pack

---

<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:** [June 10, 2019, 7:34am UTC](https://discuss.elastic.co/t/alert-triggering-for-every-30minutes/180318/9 "2019-06-10T07:34:05Z")

</div>

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