Skip to content

[all beats] Remove BEAT_LOG_OPTS from the systemd unit file #12024

@magnuslarsen

Description

@magnuslarsen

OS Version: I've only tested DEB installations on Ubuntu 18.04, but I'd imagine it happens on all systemd enabled Linux systems
Beat Version: 7.0.0, 7.0.1

In a unit file for any beat BEAT_LOG_OPTS is defaulted to -e
This will make logging options in the configuration file obsolete/ignored.

Examples:
Filebeat systemd unit file (snippet):

[Service]
Environment="BEAT_LOG_OPTS=-e"

filebeat.yml (snippet):

logging:
  level: info
  to_files: true
  to_syslog: false
  json: true
  files:
    path: '/var/log/filebeat'
    name: 'filebeat'
    keepfiles: '7'
    permissions: '0644'

Expected result:
Logging to files in the /var/log/filebeat directory

Actual result:
Logging to /var/log/syslog

Why not keep all the configurations in the configuration file, instead of having it split up in 2 files: systemd drop in file for logging options, and a configuration file for all other options?

Blindly removing the environmental variable BEAT_LOG_OPTS results in the configuration file being used for everything, and for logging to happen in the expected result.
Is there ANY reason not to do this? It's both much simpler AND much cleaner for the user.

Metadata

Metadata

Assignees

Labels

discussIssue needs further discussion.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions