Skip to content

Commit

Permalink
Add warning for logging configuration on systemd (#12577) (#12660)
Browse files Browse the repository at this point in the history
Since 7.0 we add the `-e` flag to all beats from the systemd unit file.
This make them to log to stderr on systems with systemd, what is the
recommended behaviour on these systems, so local logs are managed by
journald. This creates some confusion as the added flags make beats
ignore other output settings added to the configuration files.
Add a new warning in the logging configuration page about this.

(cherry picked from commit a6cd5e8)
  • Loading branch information
jsoriano authored Jun 25, 2019
1 parent a27311a commit 712ef84
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 2 deletions.
3 changes: 3 additions & 0 deletions auditbeat/auditbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,9 @@ setup.kibana:
# Multiple selectors can be chained.
#logging.selectors: [ ]

# Send all logging output to stderr. The default is false.
#logging.to_stderr: false

# Send all logging output to syslog. The default is false.
#logging.to_syslog: false

Expand Down
3 changes: 3 additions & 0 deletions filebeat/filebeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1858,6 +1858,9 @@ setup.kibana:
# Multiple selectors can be chained.
#logging.selectors: [ ]

# Send all logging output to stderr. The default is false.
#logging.to_stderr: false

# Send all logging output to syslog. The default is false.
#logging.to_syslog: false

Expand Down
3 changes: 3 additions & 0 deletions heartbeat/heartbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,9 @@ setup.kibana:
# Multiple selectors can be chained.
#logging.selectors: [ ]

# Send all logging output to stderr. The default is false.
#logging.to_stderr: false

# Send all logging output to syslog. The default is false.
#logging.to_syslog: false

Expand Down
3 changes: 3 additions & 0 deletions journalbeat/journalbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,9 @@ setup.kibana:
# Multiple selectors can be chained.
#logging.selectors: [ ]

# Send all logging output to stderr. The default is false.
#logging.to_stderr: false

# Send all logging output to syslog. The default is false.
#logging.to_syslog: false

Expand Down
3 changes: 3 additions & 0 deletions libbeat/_meta/config.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,9 @@ setup.kibana:
# Multiple selectors can be chained.
#logging.selectors: [ ]

# Send all logging output to stderr. The default is false.
#logging.to_stderr: false

# Send all logging output to syslog. The default is false.
#logging.to_syslog: false

Expand Down
13 changes: 13 additions & 0 deletions libbeat/docs/loggingconfig.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ endif::win_only[]
TIP: In addition to setting logging options in the config file, you can modify
the logging output configuration from the command line. See
<<command-line-options>>.

ifndef::win_only[]
WARNING: When {beatname_uc} is running on a Linux system with systemd, it uses
by default the `-e` command line option, that makes it write all the logging output
to stderr so it can be captured by journald. Other outputs are disabled. See
<<running-with-systemd>> to know more and learn how to change this.
endif::win_only[]
endif::serverless[]

ifdef::serverless[]
Expand Down Expand Up @@ -77,6 +84,12 @@ You can specify the following options in the `logging` section of the
+{beatname_lc}.yml+ config file:

ifndef::serverless[]
[float]
==== `logging.to_stderr`

When true, writes all logging output to standard error output. This is
equivalent to using the `-e` command line option.

[float]
==== `logging.to_syslog`

Expand Down
4 changes: 2 additions & 2 deletions libbeat/docs/shared-systemd.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ would override `BEAT_LOG_OPTS` to enable debug for Elasticsearch output.
Environment="BEAT_LOG_OPTS=-e -d elasticsearch"
------------------------------------------------

To use settings from the {beatname_uc} file, empty the environment
variable. For example:
To change the logging output from the {beatname_uc} configuration file, empty
the environment variable. For example:

["source", "systemd", subs="attributes"]
------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1746,6 +1746,9 @@ setup.kibana:
# Multiple selectors can be chained.
#logging.selectors: [ ]

# Send all logging output to stderr. The default is false.
#logging.to_stderr: false

# Send all logging output to syslog. The default is false.
#logging.to_syslog: false

Expand Down
3 changes: 3 additions & 0 deletions packetbeat/packetbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1497,6 +1497,9 @@ setup.kibana:
# Multiple selectors can be chained.
#logging.selectors: [ ]

# Send all logging output to stderr. The default is false.
#logging.to_stderr: false

# Send all logging output to syslog. The default is false.
#logging.to_syslog: false

Expand Down
3 changes: 3 additions & 0 deletions winlogbeat/winlogbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,9 @@ setup.kibana:
# Multiple selectors can be chained.
#logging.selectors: [ ]

# Send all logging output to stderr. The default is false.
#logging.to_stderr: false

# Send all logging output to syslog. The default is false.
#logging.to_syslog: false

Expand Down
3 changes: 3 additions & 0 deletions x-pack/auditbeat/auditbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,9 @@ setup.kibana:
# Multiple selectors can be chained.
#logging.selectors: [ ]

# Send all logging output to stderr. The default is false.
#logging.to_stderr: false

# Send all logging output to syslog. The default is false.
#logging.to_syslog: false

Expand Down
3 changes: 3 additions & 0 deletions x-pack/filebeat/filebeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1999,6 +1999,9 @@ setup.kibana:
# Multiple selectors can be chained.
#logging.selectors: [ ]

# Send all logging output to stderr. The default is false.
#logging.to_stderr: false

# Send all logging output to syslog. The default is false.
#logging.to_syslog: false

Expand Down
3 changes: 3 additions & 0 deletions x-pack/functionbeat/functionbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,9 @@ setup.kibana:
# Multiple selectors can be chained.
#logging.selectors: [ ]

# Send all logging output to stderr. The default is false.
#logging.to_stderr: false

# Send all logging output to syslog. The default is false.
#logging.to_syslog: false

Expand Down
3 changes: 3 additions & 0 deletions x-pack/metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1810,6 +1810,9 @@ setup.kibana:
# Multiple selectors can be chained.
#logging.selectors: [ ]

# Send all logging output to stderr. The default is false.
#logging.to_stderr: false

# Send all logging output to syslog. The default is false.
#logging.to_syslog: false

Expand Down
3 changes: 3 additions & 0 deletions x-pack/winlogbeat/winlogbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,9 @@ setup.kibana:
# Multiple selectors can be chained.
#logging.selectors: [ ]

# Send all logging output to stderr. The default is false.
#logging.to_stderr: false

# Send all logging output to syslog. The default is false.
#logging.to_syslog: false

Expand Down

0 comments on commit 712ef84

Please sign in to comment.