[filebeat] not generating logs when logging set to debug

Hi,
i have configured logging in filebeat.yml

#================================ Logging =====================================

# Sets log level. The default log level is info.
# Available log levels are: error, warning, info, debug
logging.level: debug

# At debug level, you can selectively enable logging only for some components.
# To enable all selectors use ["*"]. Examples of other selectors are "beat",
# "publish", "service".
#logging.selectors: ["*"]

# Logging to rotating files. Set logging.to_files to false to disable logging to
# files.
logging.to_files: true
logging.files:
  # Configure the path where the logs are written. The default is the logs directory
  # under the home path (the binary location).
  path: /var/log/filebeat

  # The name of the files where the logs are written to.
  name: filebeat

  # Configure log file size limit. If limit is reached, log file will be
  # automatically rotated
  rotateeverybytes: 10485760 # = 10MB

  # Number of rotated log files to keep. Oldest files will be deleted first.
  keepfiles: 7

  # The permissions mask to apply when rotating log files. The default value is 0600.
  # Must be a valid Unix-style file permissions mask expressed in octal notation.
  permissions: 0600

however when i start filebeat with

systemctl start filebeat

i seet filebeat is started with -e option and no log is generated.

I found no way to enable to make it generate logs other than staring it manually without the -e option.

I also tried to modify the /etc/init.d/filebeat to remove the -e option but it starts with -e option.

Does anyone faced to it? should i modify something else?

thanks

systemctl is the systemd tool. The init file you have modified is only a fallback when systemd is not used.
The systemd configuration should be in /etc/systemd/system/filebeat.service I think.

Thanks steffens, but theres is no file in /etc/systemd/system called filebeat.service
i have logstash.service and other ones but no filebeat, dont know where it should be getting the startup script.

How did you install filebeat?

Can you check if /lib/systemd/system/filebeat.service exists?

Thanks Steffens!, i found file /lib/systemd/system/filebeat.service and had a line
Environment="BEAT_LOG_OPTS=-e"
i commented the line and when i restarted the service it did not start with -e option.

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