# Beats writing logs to messages

**URL:** <https://discuss.elastic.co/t/beats-writing-logs-to-messages/205144>\
**Category:** Beats\
**Created:** [October 24, 2019, 7:35pm UTC](https://discuss.elastic.co/t/beats-writing-logs-to-messages/205144 "2019-10-24T19:35:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Senthil\_ak](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@Senthil\_ak](https://discuss.elastic.co/u/Senthil_ak)\
**Post date:** [October 24, 2019, 7:35pm UTC](https://discuss.elastic.co/t/beats-writing-logs-to-messages/205144/1 "2019-10-24T19:35:34Z")

</div>

Hi Team,  
Even though I've setting for writing beat logs to file its still writing the logs to messages only. Below is the config for metricbeat i have the same for filebeat too. But both writing ton of logs to /var/logs/messages, How to avoid those ?

```
logging.level: info
logging.to_syslog: false
logging.to_files: true
logging.files:
  path: /opt/metricbeat/logs
  name: metricbeat
  keepfiles: 15
  permissions: 0755
```

---

<div class="post-metadata">

**Author:** ![pmercado](https://avatars.discourse-cdn.com/v4/letter/p/59ef9b/32.png) [@pmercado](https://discuss.elastic.co/u/pmercado)\
**Post date:** [October 25, 2019, 1:30pm UTC](https://discuss.elastic.co/t/beats-writing-logs-to-messages/205144/2 "2019-10-25T13:30:01Z")

</div>

Hy @Senthil_ak,

I have just tested that config and its works as expected for me.  
Can you make sure that:

- you are pointing to the right config file (use `-c` option)
- there are no flags like `-e` at the command line that would tell the beat to write to stdout

---

<div class="post-metadata">

**Author:** ![Senthil\_ak](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@Senthil\_ak](https://discuss.elastic.co/u/Senthil_ak)\
**Post date:** [October 31, 2019, 5:56pm UTC](https://discuss.elastic.co/t/beats-writing-logs-to-messages/205144/3 "2019-10-31T17:56:10Z")

</div>

I am running systemd process and I have file its like below

```
[Unit]
Description=Filebeat sends log files to Logstash or directly to Elasticsearch.
Documentation=https://www.elastic.co/products/beats/filebeat
Wants=network-online.target
After=network-online.target

[Service]

Environment="BEAT_LOG_OPTS=-e"
Environment="BEAT_CONFIG_OPTS=-c /etc/filebeat/filebeat.yml"
Environment="BEAT_PATH_OPTS=-path.home /usr/share/filebeat -path.config /etc/filebeat -path.data /apps/filebeat/data -path.logs /apps/filebeat/logs"
ExecStart=/usr/share/filebeat/bin/filebeat $BEAT_LOG_OPTS $BEAT_CONFIG_OPTS $BEAT_PATH_OPTS
Restart=always

[Install]
WantedBy=multi-user.target
```

---

<div class="post-metadata">

**Author:** ![pmercado](https://avatars.discourse-cdn.com/v4/letter/p/59ef9b/32.png) [@pmercado](https://discuss.elastic.co/u/pmercado)\
**Post date:** [November 5, 2019, 12:45pm UTC](https://discuss.elastic.co/t/beats-writing-logs-to-messages/205144/4 "2019-11-05T12:45:30Z")

</div>

Can you try commenting the line that sets the `-e` option?

---

<div class="post-metadata">

**Author:** ![Senthil\_ak](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@Senthil\_ak](https://discuss.elastic.co/u/Senthil_ak)\
**Post date:** [November 8, 2019, 7:18pm UTC](https://discuss.elastic.co/t/beats-writing-logs-to-messages/205144/5 "2019-11-08T19:18:25Z")

</div>

I already tried this but still not working.

---

<div class="post-metadata">

**Author:** ![pmercado](https://avatars.discourse-cdn.com/v4/letter/p/59ef9b/32.png) [@pmercado](https://discuss.elastic.co/u/pmercado)\
**Post date:** [November 12, 2019, 10:45pm UTC](https://discuss.elastic.co/t/beats-writing-logs-to-messages/205144/6 "2019-11-12T22:45:24Z")

</div>

can you `ps -ef | grep filebeat` after starting the server and post here what you find?

---

<div class="post-metadata">

**Author:** ![Senthil\_ak](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@Senthil\_ak](https://discuss.elastic.co/u/Senthil_ak)\
**Post date:** [November 13, 2019, 1:59pm UTC](https://discuss.elastic.co/t/beats-writing-logs-to-messages/205144/7 "2019-11-13T13:59:16Z")

</div>

Please find the output below.

`root 4504 1 6 08:57 ? 00:00:00 /usr/share/filebeat/bin/filebeat -c /etc/filebeat/filebeat.yml -path.home /usr/share/filebeat -path.config /etc/filebeat -path.data /apps/filebeat/data -path.logs /apps/filebeat/logs`

---

<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:** [December 11, 2019, 3:59pm UTC](https://discuss.elastic.co/t/beats-writing-logs-to-messages/205144/8 "2019-12-11T15:59:17Z")

</div>

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