Cfgfile - is not read after first failed attempt

I thought it was interesting observation that the changed cfgfile was not re-read after the first attempt failed, until I restarted filebeat.
Maybe there is an option I am missing to re-read failed config files.

filebeat.config.inputs:
  enabled: true
  path: /tmp/inputs.d/*.yml
  reload.enabled: true
  reload.period: 60s

Steps:

  1. Created an inputs.d/ folder
  2. Added to the filebeat.yml to read new cfgfile changes every 60s
  3. Added a new cfgfile in the folder with a .yml extension
  4. cfgfile is read the first time with an error
  5. corrected the the error
  6. cfgfile is not read again until filebeat service is restarted.
root@chris-Standard-PC-Q35-ICH9-2009:/tmp# grep cfgfile /var/log/filebeat/filebeat.2
2020-04-07T16:27:23.837-0600    DEBUG   [cfgfile]       cfgfile/reload.go:137   Checking module configs from: /etc/filebeat/modules.d/*.yml
2020-04-07T16:27:23.837-0600    DEBUG   [cfgfile]       cfgfile/reload.go:151   Number of module configs found: 0
2020-04-07T16:27:23.837-0600    INFO    cfgfile/reload.go:175   Config reloader started
2020-04-07T16:27:23.837-0600    INFO    cfgfile/reload.go:175   Config reloader started
2020-04-07T16:27:23.838-0600    DEBUG   [cfgfile]       cfgfile/reload.go:205   Scan for new config files
2020-04-07T16:27:23.838-0600    DEBUG   [cfgfile]       cfgfile/reload.go:224   Number of module configs found: 0
2020-04-07T16:27:23.838-0600    DEBUG   [reload]        cfgfile/list.go:62      Starting reload procedure, current runners: 0
2020-04-07T16:27:23.838-0600    DEBUG   [reload]        cfgfile/list.go:80      Start list: 0, Stop list: 0
2020-04-07T16:27:23.838-0600    INFO    cfgfile/reload.go:235   Loading of config files completed.
2020-04-07T16:28:23.838-0600    DEBUG   [cfgfile]       cfgfile/reload.go:205   Scan for new config files
2020-04-07T16:28:23.838-0600    DEBUG   [cfgfile]       cfgfile/cfgfile.go:193  Load config from file: /tmp/inputs.d/a.yml
2020-04-07T16:28:23.838-0600    ERROR   cfgfile/reload.go:284   Error loading config from file '/tmp/inputs.d/a.yml', error invalid config: config file ("/tmp/inputs.d/a.yml") can only be writable by the owner but the permissions are "-rw-rw-r--" (to fix the permissions use: 'chmod go-w /tmp/inputs.d/a.yml')
2020-04-07T16:28:23.838-0600    DEBUG   [cfgfile]       cfgfile/reload.go:224   Number of module configs found: 0
2020-04-07T16:28:23.838-0600    DEBUG   [reload]        cfgfile/list.go:62      Starting reload procedure, current runners: 0
2020-04-07T16:28:23.838-0600    DEBUG   [reload]        cfgfile/list.go:80      Start list: 0, Stop list: 0
2020-04-07T16:29:23.839-0600    DEBUG   [cfgfile]       cfgfile/reload.go:205   Scan for new config files
2020-04-07T16:30:23.840-0600    DEBUG   [cfgfile]       cfgfile/reload.go:205   Scan for new config files
2020-04-07T16:31:23.841-0600    DEBUG   [cfgfile]       cfgfile/reload.go:205   Scan for new config files
2020-04-07T16:32:23.842-0600    DEBUG   [cfgfile]       cfgfile/reload.go:205   Scan for new config files
2020-04-07T16:33:23.842-0600    DEBUG   [cfgfile]       cfgfile/reload.go:205   Scan for new config files

Thanks

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