# Metricbeat does not respect on output.file.permissions

**URL:** <https://discuss.elastic.co/t/metricbeat-does-not-respect-on-output-file-permissions/227325>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [April 9, 2020, 1:17pm UTC](https://discuss.elastic.co/t/metricbeat-does-not-respect-on-output-file-permissions/227325 "2020-04-09T13:17:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [April 9, 2020, 1:17pm UTC](https://discuss.elastic.co/t/metricbeat-does-not-respect-on-output-file-permissions/227325/1 "2020-04-09T13:17:30Z")

</div>

Hi, my metricbeat config for file output is this:

```
output.file:
  # Boolean flag to enable or disable the output module.
  enabled: True

  # Configure JSON encoding
  #codec.json:
    # Pretty-print JSON event
    #pretty: false

    # Configure escaping HTML symbols in strings.
    #escape_html: false

  # Path to the directory where to save the generated files. The option is
  # mandatory.
  path: "/var/log/metricbeat/probes"

  # Name of the generated files. The default is `metricbeat` and it generates
  # files: `metricbeat`, `metricbeat.1`, `metricbeat.2`, etc.
  filename: metricbeat_probes.log

  # Maximum size in kilobytes of each file. When this size is reached, and on
  # every Metricbeat restart, the files are rotated. The default value is 10240
  # kB.
  rotate_every_kb: 10240

  # Maximum number of files under path. When this number of files is reached,
  # the oldest file is deleted and the rest are shifted from last to first. The
  # default is 7 files.
  number_of_files: 3

  # Permissions to use for file creation. The default is 0600.
  permissions: 0644

```

But the created files have 0640 permissions:

```
[root@elastic01 probes]# pwd
/var/log/metricbeat/probes
[root@elastic01 probes]# ls -l
total 68
-rw-r-----. 1 metricbeat metricbeat 68454 Apr 9 15:15 metricbeat_probes.log

```

I am using metricbeat 7.5.2.  
I am running metricbeat as unprivilleged user called `metricbeat`.

Any ideas how to solve this issue?

---

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [April 9, 2020, 1:27pm UTC](https://discuss.elastic.co/t/metricbeat-does-not-respect-on-output-file-permissions/227325/2 "2020-04-09T13:27:28Z")

</div>

same issue when running as root

---

<div class="post-metadata">

**Author:** ![Kaiyan\_Sheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaiyan_sheng/32/38247_2.png) [@Kaiyan\_Sheng](https://discuss.elastic.co/u/Kaiyan_Sheng)\
**Post date:** [April 10, 2020, 8:01pm UTC](https://discuss.elastic.co/t/metricbeat-does-not-respect-on-output-file-permissions/227325/3 "2020-04-10T20:01:59Z")

</div>

Thanks for posting your question here. I was able to reproduce this issue with master branch Metricbeat. I see INFO log showing:

```auto
2020-04-10T13:59:56.887-0600 INFO [file] fileout/file.go:100 Initialized file output. path=/Users/kaiyansheng/metricbeat-logs/metricbeat_probes.log max_size_bytes=10485760 max_backups=3 permissions=-rw-r--r--

```

But still the output log file is

```auto
-rw-r----- 1 kaiyansheng staff 17K Apr 10 13:56 metricbeat_probes.log

```

Could you please create an issue for this in Beats github repo please?

---

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [April 16, 2020, 6:19am UTC](https://discuss.elastic.co/t/metricbeat-does-not-respect-on-output-file-permissions/227325/4 "2020-04-16T06:19:53Z")

</div>

Here it is

> <https://github.com/elastic/beats/issues/17745>
>
> Please post all questions and issues on https://discuss.elastic.co/c/beats
> before opening a Github Issue. Your questions will reach a wider audience there,
> and if...

---

<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:** [May 14, 2020, 6:19am UTC](https://discuss.elastic.co/t/metricbeat-does-not-respect-on-output-file-permissions/227325/5 "2020-05-14T06:19:56Z")

</div>

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