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
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.
$ ./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
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.
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!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.