# How create one kapacitor alert valid for multiple devices?

**URL:** <https://community.influxdata.com/t/how-create-one-kapacitor-alert-valid-for-multiple-devices/11632>\
**Category:** Systems\
**Tags:** kapacitor\
**Created:** [October 17, 2019, 8:59am UTC](https://community.influxdata.com/t/how-create-one-kapacitor-alert-valid-for-multiple-devices/11632 "2019-10-17T08:59:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Federico\_Olivieri](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/federico_olivieri/32/3712_2.png) [@Federico\_Olivieri](https://community.influxdata.com/u/Federico_Olivieri)\
**Post date:** [October 17, 2019, 8:59am UTC](https://community.influxdata.com/t/how-create-one-kapacitor-alert-valid-for-multiple-devices/11632/1 "2019-10-17T08:59:56Z")

</div>

Hello! This is a Kapacitor question 🙂  
I am quite new to Kapacitor so apologies if my question sounds bit dumb  
I need to create a bunch of alerts rues for different devices in the same DB and they have the same threshold (i.e all routers - CPU threshold 80%) . The only thing that change is obviously the hostname for each device. I was wondering if there is a quicker and clean way to do it instead to create a rule for each device. Anything that template can help me with? Thanks

---

<div class="post-metadata">

**Author:** ![Federico\_Olivieri](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/federico_olivieri/32/3712_2.png) [@Federico\_Olivieri](https://community.influxdata.com/u/Federico_Olivieri)\
**Post date:** [October 17, 2019, 10:06am UTC](https://community.influxdata.com/t/how-create-one-kapacitor-alert-valid-for-multiple-devices/11632/2 "2019-10-17T10:06:05Z")

</div>

Found it: GROUP BY does the trick

---

<div class="post-metadata">

**Author:** ![philb](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/philb/32/1805_2.png) [@philb](https://community.influxdata.com/u/philb)\
**Post date:** [October 17, 2019, 3:57pm UTC](https://community.influxdata.com/t/how-create-one-kapacitor-alert-valid-for-multiple-devices/11632/3 "2019-10-17T15:57:35Z")

</div>

You also need to use the group by function for any tags you want to retain or use in your alert.

That is, if you want to use the value of the host tag then group by host, if you were monitoring disk or CPU instances then you would include the “instance” tag.

You can also wild card the group by to just include all tags `groupBy(*)`, but if you have a lot of tags it might be better to specify the tags you want.
