# Auditbeat: monitoring of single files fails with 'recursive: true'

**URL:** https://discuss.elastic.co/t/auditbeat-monitoring-of-single-files-fails-with-recursive-true/258287
**Category:** Beats
**Tags:** auditbeat
**Created:** [December 10, 2020, 2:23pm UTC](https://discuss.elastic.co/t/auditbeat-monitoring-of-single-files-fails-with-recursive-true/258287 "2020-12-10T14:23:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![matletix](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matletix/32/80596_2.png) [@matletix](https://discuss.elastic.co/u/matletix)
#### Post date: [December 10, 2020, 2:23pm UTC](https://discuss.elastic.co/t/auditbeat-monitoring-of-single-files-fails-with-recursive-true/258287/1 "2020-12-10T14:23:40Z")

</div>

Let's say I want to monitor the `/watch_me.txt` file with auditbeat file\_integrity module. The following configuration do work and send events on modifications of this file :

```auto
- module: file_integrity
  enabled: true
  paths:
  - /watch_me.txt

  recursive: false

```

Now I want to also monitor all the files in all the `/etc/` directory and its subfolders recursively. So I add the path to `/etc` to the paths list and I enable the `recursive` option :

```auto
- module: file_integrity
  enabled: true
  paths:
  - /etc
  - /watch_me.txt

  recursive: true

```

Problem : auditbeat doesn't send events on modifications of the `/watch_me.txt` file anymore with this last configuration. After some tests, I realized that when you specify individual files (and not directories) in the `paths` list, then these files won't be monitored if the recursive option is set to true. Only directories and their content are monitored when `recursive` is true.

Is this expected behaviour ? How can I watch both individual files and entire directories ?

Thank you,

Mathieu

PS: I use the `auditbeat:7.8.1` docker image from [https://www.docker.elastic.co/r/beats](https://www.docker.elastic.co/r/beats)

---

<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: [January 7, 2021, 4:23pm UTC](https://discuss.elastic.co/t/auditbeat-monitoring-of-single-files-fails-with-recursive-true/258287/2 "2021-01-07T16:23:49Z")

</div>

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