# AuditLog index filtering problem

**URL:** <https://discuss.elastic.co/t/auditlog-index-filtering-problem/162852>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [January 3, 2019, 5:15pm UTC](https://discuss.elastic.co/t/auditlog-index-filtering-problem/162852 "2019-01-03T17:15:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmisztal1980](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mmisztal1980/32/38519_2.png) [@mmisztal1980](https://discuss.elastic.co/u/mmisztal1980)\
**Post date:** [January 3, 2019, 5:15pm UTC](https://discuss.elastic.co/t/auditlog-index-filtering-problem/162852/1 "2019-01-03T17:15:20Z")

</div>

Hi. We are using the ElasticStack v 6.5.3 .

Our requirements are to only record audit events originating from 2x index patterns exclusively:

- aaa-\*
- bbb-\*

Here is a fragment of our configuration in **elasticsearch.yml**

```auto
xpack.security.audit.enabled: true
xpack.security.audit.outputs: [logfile]
xpack.security.audit.logfile.events.ignore_filters.name.realms: ["reserved", " __anonymous", "__ attach"]
xpack.security.audit.logfile.events.ignore_filters.name.indices: ["~(aaa|bbb)-*"]
xpack.security.audit.logfile.events.ignore_filters.name.users: ["beat"]
xpack.security.audit.logfile.events.emit_request_body: false

```

- We have tried to achieve our goal by creating a lucene regexp with a negation but this seems to be ignored. Can you point us to a correct solution?
- Will it be possible to include the request body, assuming the per-index filtering is active?

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [January 7, 2019, 9:38am UTC](https://discuss.elastic.co/t/auditlog-index-filtering-problem/162852/2 "2019-01-07T09:38:43Z")

</div>

Hi @mmisztal1980 ,

- You need to contain the regexp in `/`
- You are missing a `.` because `*` will match the preceding shortest pattern zero-or-more times and you need to tell it what is the preceding shortest pattern it needs to match ( in your case any character i.e. `.`

```auto
xpack.security.audit.logfile.events.ignore_filters.name.indices: ["/~(aaa|bbb)-.*/"]

```

---

<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:** [February 4, 2019, 9:38am UTC](https://discuss.elastic.co/t/auditlog-index-filtering-problem/162852/3 "2019-02-04T09:38:56Z")

</div>

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