# Restricting kibana watchers across spaces

**URL:** https://discuss.elastic.co/t/restricting-kibana-watchers-across-spaces/304496
**Category:** Kibana
**Tags:** elastic-stack-alerting
**Created:** [May 11, 2022, 6:32pm UTC](https://discuss.elastic.co/t/restricting-kibana-watchers-across-spaces/304496 "2022-05-11T18:32:41Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![venkatkumar229](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/venkatkumar229/32/104663_2.png) [@venkatkumar229](https://discuss.elastic.co/u/venkatkumar229)
#### Post date: [May 11, 2022, 6:32pm UTC](https://discuss.elastic.co/t/restricting-kibana-watchers-across-spaces/304496/1 "2022-05-11T18:32:41Z")

</div>

Hi Team,

We are using Elastic cloud 7.16.2 version and we are using spaces to restrict users to access only the data related to them. Now we want to provide access to them to create and manage kibana watchers by themselves. I am tried by giving manage\_watcher and watcher\_admin roles to users and but users are able to see all the watchers and getting access to delete everything in the watchers.

So could you please let me know a way to restrict watchers in each space. Like the rules and connectors which are space isolated.

---

<div class="post-metadata">

### Author: ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)
#### Post date: [May 12, 2022, 10:07pm UTC](https://discuss.elastic.co/t/restricting-kibana-watchers-across-spaces/304496/2 "2022-05-12T22:07:42Z")

</div>

Hello,

Watcher is an Elasticsearch feature and Kibana has the management interface to it. Its not space aware.

I am also wondering why you are using watcher and not alerts.

Thanks,  
Bhavya

---

<div class="post-metadata">

### Author: ![venkatkumar229](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/venkatkumar229/32/104663_2.png) [@venkatkumar229](https://discuss.elastic.co/u/venkatkumar229)
#### Post date: [May 13, 2022, 1:45am UTC](https://discuss.elastic.co/t/restricting-kibana-watchers-across-spaces/304496/3 "2022-05-13T01:45:10Z")

</div>

Hi Bhavya,

We are using watchers because

1. We can able to format the email body using html.
2. We are using aggregation queries and we need to print the buckets in the email which we tried using alerts but no luck. We are able to print the hits using context.hits.

Could you please let me know if there is any way in formatting the data in alerts to print like a table data also to print aggregated data.

Thanks in Advance.

---

<div class="post-metadata">

### Author: ![venkatkumar229](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/venkatkumar229/32/104663_2.png) [@venkatkumar229](https://discuss.elastic.co/u/venkatkumar229)
#### Post date: [May 23, 2022, 6:35pm UTC](https://discuss.elastic.co/t/restricting-kibana-watchers-across-spaces/304496/4 "2022-05-23T18:35:12Z")

</div>

Hi @bhavyarm ,

Could you please help me with the query.

---

<div class="post-metadata">

### Author: ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)
#### Post date: [May 25, 2022, 3:20pm UTC](https://discuss.elastic.co/t/restricting-kibana-watchers-across-spaces/304496/5 "2022-05-25T15:20:58Z")

</div>

@Patrick_Mueller / @ying.mao can we please get some help? Thanks!

---

<div class="post-metadata">

### Author: ![Patrick\_Mueller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_mueller/32/109425_2.png) [@Patrick\_Mueller](https://discuss.elastic.co/u/Patrick_Mueller)
#### Post date: [May 25, 2022, 3:48pm UTC](https://discuss.elastic.co/t/restricting-kibana-watchers-across-spaces/304496/6 "2022-05-25T15:48:34Z")

</div>

> 1. We can able to format the email body using html.

The email message is processed with mustache to fill in "variables", and then markdown to convert to HTML. We currently do not allow HTML elements within the message, they will be rendered literally in the output. Are there specific HTML elements you need?

> 1. We are using aggregation queries and we need to print the buckets in the email which we tried using alerts but no luck. We are able to print the hits using context.hits.

I don't believe we have a rule type that both does aggregations AND returns search hits - most of our rule types are agg-based, though the elasticsearch query rule type does not currently do aggs and only returns search hits. It sounds like you were using the elasticsearch query rule type. The logs threshold, metric threshold, or index threshold rule types might work if you don't need the hits, just the aggs.

---

<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 22, 2022, 3:48pm UTC](https://discuss.elastic.co/t/restricting-kibana-watchers-across-spaces/304496/7 "2022-06-22T15:48:52Z")

</div>

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