# Sending Filebeat logs to file instead of STDOUT

**URL:** <https://discuss.elastic.co/t/sending-filebeat-logs-to-file-instead-of-stdout/119131>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [February 8, 2018, 10:13pm UTC](https://discuss.elastic.co/t/sending-filebeat-logs-to-file-instead-of-stdout/119131 "2018-02-08T22:13:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![obodard](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/obodard/32/27575_2.png) [@obodard](https://discuss.elastic.co/u/obodard)\
**Post date:** [February 8, 2018, 10:13pm UTC](https://discuss.elastic.co/t/sending-filebeat-logs-to-file-instead-of-stdout/119131/1 "2018-02-08T22:13:12Z")

</div>

I'm trying to redirect the filebeat logs from STDOUT to a file, but they always end on my console.  
Filebeat version: filebeat-6.2.1-linux-x86\_64  
Config:

```
logging.level: info
logging.to_files: true
logging.files:
  path: /tmp/mybeat
  name: mybeat
  keepfiles: 7
  permissions: 0644

```

I get this (and even if I create the "logs" directory mentioned in this output, there is no difference):

> [user@localhost filebeat-6.2.1-linux-x86\_64]# **./filebeat -e -c ./filebeat.yml**  
> 2018-02-08T17:08:36.349-0500 INFO instance/beat.go:468 Home path: [/home/user/hermes/filebeat-6.2.1-linux-x86\_64] Config path: [/root/hermes/filebeat-6.2.1-linux-x86\_64] Data path: [/root/hermes/filebeat-6.2.1-linux-x86\_64/data] **Logs path: [/root/hermes/filebeat-6.2.1-linux-x86\_64/logs]**  
> 2018-02-08T17:08:36.349-0500 INFO instance/beat.go:475 Beat UUID: 801bfc70-6a38-4540-a9aa-b62c3ff4eb45  
> 2018-02-08T17:08:36.349-0500 INFO instance/beat.go:213 Setup Beat: filebeat; Version: 6.2.1  
> 2018-02-08T17:08:36.349-0500 INFO pipeline/module.go:76 Beat name: localhost.localdomain  
> 2018-02-08T17:08:36.349-0500 INFO instance/beat.go:301 filebeat start running.  
> [...much more...]

Am I missing something in filebeat.yml ?

---

<div class="post-metadata">

**Author:** ![obodard](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/obodard/32/27575_2.png) [@obodard](https://discuss.elastic.co/u/obodard)\
**Post date:** [February 8, 2018, 10:36pm UTC](https://discuss.elastic.co/t/sending-filebeat-logs-to-file-instead-of-stdout/119131/2 "2018-02-08T22:36:30Z")

</div>

I found my problem: I was using the -e option.

[root@localhost filebeat-6.2.1-linux-x86\_64]# ./filebeat --help  
Usage:  
filebeat [flags]  
filebeat [command]  
[...]  
**-e, --e Log to stderr and disable syslog/file output**

---

<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:** [March 8, 2018, 10:37pm UTC](https://discuss.elastic.co/t/sending-filebeat-logs-to-file-instead-of-stdout/119131/3 "2018-03-08T22:37:11Z")

</div>

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