# Filebeat systemd not writing logs to log directory

**URL:** <https://discuss.elastic.co/t/filebeat-systemd-not-writing-logs-to-log-directory/270247>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [April 15, 2021, 2:04pm UTC](https://discuss.elastic.co/t/filebeat-systemd-not-writing-logs-to-log-directory/270247 "2021-04-15T14:04:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![madhan\_dhanikachalam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/madhan_dhanikachalam/32/86074_2.png) [@madhan\_dhanikachalam](https://discuss.elastic.co/u/madhan_dhanikachalam)\
**Post date:** [April 15, 2021, 2:04pm UTC](https://discuss.elastic.co/t/filebeat-systemd-not-writing-logs-to-log-directory/270247/1 "2021-04-15T14:04:48Z")

</div>

I have filebeat 7.12 and have the below systemd service

```
[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="
Environment="BEAT_CONFIG_OPTS=-c /share/filebeat/filebeat.yml"
Environment="BEAT_PATH_OPTS=--path.home /share/filebeat --path.config 
/share/filebeat --path.data /share/filebeat/data --path.logs /share/filebeat/logs"
ExecStart=/share/filebeat/filebeat --environment systemd $BEAT_LOG_OPTS 
$BEAT_CONFIG_OPTS $BEAT_PATH_OPTS
Restart=always
User=filebeat
Group=filebeat
[Install] 
WantedBy=multi-user.target

```

I was hoping to get the log files under /share/filebeat/logs but they are going to /var/log/messages on my linux server.

---

<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 13, 2021, 4:04pm UTC](https://discuss.elastic.co/t/filebeat-systemd-not-writing-logs-to-log-directory/270247/2 "2021-05-13T16:04:49Z")

</div>

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