# How to trigger alert based on cloudwatch events using grafana query where based on event, other details also should trigger in alert message

**URL:** <https://community.grafana.com/t/how-to-trigger-alert-based-on-cloudwatch-events-using-grafana-query-where-based-on-event-other-details-also-should-trigger-in-alert-message/109815>\
**Category:** Alerting\
**Tags:** logs, cloudwatch, query-editor, alerting\
**Created:** [December 12, 2023, 6:11am UTC](https://community.grafana.com/t/how-to-trigger-alert-based-on-cloudwatch-events-using-grafana-query-where-based-on-event-other-details-also-should-trigger-in-alert-message/109815 "2023-12-12T06:11:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gourav2](https://avatars.discourse-cdn.com/v4/letter/g/e95f7d/32.png) [@gourav2](https://community.grafana.com/u/gourav2)\
**Post date:** [December 12, 2023, 6:11am UTC](https://community.grafana.com/t/how-to-trigger-alert-based-on-cloudwatch-events-using-grafana-query-where-based-on-event-other-details-also-should-trigger-in-alert-message/109815/1 "2023-12-12T06:11:03Z")

</div>

#all I’m stuck with alerting issue  
I’m trying to run the query as below

```auto
fields eventName 
| filter eventName =~ /DeleteBucket|DeleteBucketLifecycle|DeleteBucketPolicy|DeleteBucketReplication|DeleteBucketTagging|PutBucketLifecycle|PutBucketPolicy/ 
| stats count(*) by eventName

```

now the question is how to trigger an alarm when any event happens out of the mentioned eventNames with other info in alert message like Account Id, InstanceId etc.  
Please help
