# Is it possible to filter by agent policy?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-filter-by-agent-policy/297392>\
**Category:** Kibana\
**Created:** [February 16, 2022, 3:59pm UTC](https://discuss.elastic.co/t/is-it-possible-to-filter-by-agent-policy/297392 "2022-02-16T15:59:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Teckinfor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/teckinfor/32/101920_2.png) [@Teckinfor](https://discuss.elastic.co/u/Teckinfor)\
**Post date:** [February 16, 2022, 3:59pm UTC](https://discuss.elastic.co/t/is-it-possible-to-filter-by-agent-policy/297392/1 "2022-02-16T15:59:33Z")

</div>

Hello,

I would like to be able to monitor 2 infrastructures at the same time, I have created a space for each infrastructure as well as 2 agent policies linked to the agents of their own infrastructure.

I was wondering if there was a way to separate the agents by agent policy, for example with a filter, to get only the agents belonging to the space of the chosen infrastructure.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [March 7, 2022, 5:12pm UTC](https://discuss.elastic.co/t/is-it-possible-to-filter-by-agent-policy/297392/2 "2022-03-07T17:12:56Z")

</div>

You may want to create index aliases with your filter, and then expose them per space.

> **[Aliases API | Elasticsearch Guide \[8.0\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html)**

---

<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:** [April 4, 2022, 5:12pm UTC](https://discuss.elastic.co/t/is-it-possible-to-filter-by-agent-policy/297392/3 "2022-04-04T17:12:57Z")

</div>

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