# Running filebeat as a binary, got log ERR on invalid config file

**URL:** https://discuss.elastic.co/t/running-filebeat-as-a-binary-got-log-err-on-invalid-config-file/92737
**Category:** Beats
**Tags:** filebeat
**Created:** [July 12, 2017, 12:02am UTC](https://discuss.elastic.co/t/running-filebeat-as-a-binary-got-log-err-on-invalid-config-file/92737 "2017-07-12T00:02:30Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![filebeater](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/filebeater/32/18565_2.png) [@filebeater](https://discuss.elastic.co/u/filebeater)
#### Post date: [July 12, 2017, 12:02am UTC](https://discuss.elastic.co/t/running-filebeat-as-a-binary-got-log-err-on-invalid-config-file/92737/1 "2017-07-12T00:02:30Z")

</div>

Hello,  
I am trying to package and run filebeat as a self-contained binary, as opposed to running it as system service: "sudo /etc/init.d/filebeat start"

I supplied various path parameters in command line when running filebeat in the following example:  
./filebeat -path.home /usr/share/filebeat -path.config /home/yyu/tools/filebeat -path.data /home/yyu/cloud/external/src/github.com/elastic/beats/filebeat/yy -path.logs /home/yyu/cloud/external/src/github.com/elastic/beats/filebeat/yy

This seems working fine except the error message in the log file.  
2017-07-11T16:38:53-07:00 ERR Error loading config: invalid config: open **/etc/filebeat/filebeat.yml** : permission denied

however, the first line in the log file is:  
2017-07-11T16:38:43-07:00 INFO Home path: [/usr/share/filebeat] Config path: [/ **home/yyu/tools/filebeat**] Data path: [/home/yyu/cloud/external/src/github.com/elastic/beats/filebeat/yy] Logs path: [/home/yyu/cloud /external/src/github.com/elastic/beats/filebeat/yy]

I am confused by the above two conflicting log messages, INFO says the config path is home/yyu/tools/filebeat, which is correct. However, the log ERR message says the config path is /etc/filebeat??

Could someone please shed some lights on this?  
thanks!  
yan

---

<div class="post-metadata">

### Author: ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)
#### Post date: [July 12, 2017, 12:25am UTC](https://discuss.elastic.co/t/running-filebeat-as-a-binary-got-log-err-on-invalid-config-file/92737/2 "2017-07-12T00:25:53Z")

</div>

What version are you testing?

---

<div class="post-metadata">

### Author: ![filebeater](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/filebeater/32/18565_2.png) [@filebeater](https://discuss.elastic.co/u/filebeater)
#### Post date: [July 12, 2017, 12:50am UTC](https://discuss.elastic.co/t/running-filebeat-as-a-binary-got-log-err-on-invalid-config-file/92737/3 "2017-07-12T00:50:40Z")

</div>

./filebeat --version  
filebeat version 6.0.0-beta1 (amd64), libbeat 6.0.0-beta1

I git cloned yesterday afternoon (PCT), and build it from the master branch

---

<div class="post-metadata">

### Author: ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)
#### Post date: [July 13, 2017, 5:31pm UTC](https://discuss.elastic.co/t/running-filebeat-as-a-binary-got-log-err-on-invalid-config-file/92737/4 "2017-07-13T17:31:02Z")

</div>

I wasn't able to reproduce this. I am seeing it attempt to read `filebeat.yml` in whatever directory I specify in the `-path.config` option.

```auto
$ ./filebeat -e -d "*" -path.config /tmp
filebeat2017/07/13 17:30:26.210137 beat.go:650: CRIT Exiting: error loading config file: stat /tmp/filebeat.yml: no such file or directory
Exiting: error loading config file: stat /tmp/filebeat.yml: no such file or directory

```

---

<div class="post-metadata">

### Author: ![filebeater](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/filebeater/32/18565_2.png) [@filebeater](https://discuss.elastic.co/u/filebeater)
#### Post date: [July 17, 2017, 11:59pm UTC](https://discuss.elastic.co/t/running-filebeat-as-a-binary-got-log-err-on-invalid-config-file/92737/5 "2017-07-17T23:59:11Z")

</div>

never mind, i found the reason, it is due to the config file.  
in the filebeat.yml which I copied from the default provided with the package, it kept the following line.  
filebeat.config.prospectors:  
path: /etc/filebeat/\*.yml  
reload.enabled: true  
reload.period: 10s

Sorry for the false alarm, it is not code bug. However, I am wondering why the config file path could be specified both in the command line and inside config file itself.  
It is very strange that the config file path is specified inside the config file itself, since if we can read the config file, it means that we already know the config file path, then it does not need to be specified in the config file; otherwise, it is pointless to set the config file path inside the config file.

---

<div class="post-metadata">

### Author: ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)
#### Post date: [July 19, 2017, 1:33am UTC](https://discuss.elastic.co/t/running-filebeat-as-a-binary-got-log-err-on-invalid-config-file/92737/6 "2017-07-19T01:33:25Z")

</div>

The path specified in the config file is supposed to point to a "conf.d" like directory where you can drop in application specific filebeat config (like for apache or nginx). It's not supposed to point to itself and it doesn't appear to [https://github.com/elastic/beats/blob/v6.0.0-alpha2/filebeat/filebeat.full.yml#L432](https://github.com/elastic/beats/blob/v6.0.0-alpha2/filebeat/filebeat.full.yml#L432).

---

<div class="post-metadata">

### Author: ![filebeater](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/filebeater/32/18565_2.png) [@filebeater](https://discuss.elastic.co/u/filebeater)
#### Post date: [July 21, 2017, 12:27am UTC](https://discuss.elastic.co/t/running-filebeat-as-a-binary-got-log-err-on-invalid-config-file/92737/7 "2017-07-21T00:27:26Z")

</div>

oops, my bad,  
I must have misunderstood the comments in the default config file initially, I thought I need to add this in the config file in order for filebeat to reload the config file periodically. then i completely forgot that i added this:(  
so filebeat will reload config file regardless of whether  
the config path is supplied in command line or in the config file itself? thanks!

```
  # Enable filebeat config reloading
  #filebeat.config.prospectors:
  #enabled: false
  #path: configs/*.yml
```

---

<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: [August 18, 2017, 12:28am UTC](https://discuss.elastic.co/t/running-filebeat-as-a-binary-got-log-err-on-invalid-config-file/92737/8 "2017-08-18T00:28:21Z")

</div>

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