From c2d7b13d45d4c8ee033fabdb8344089a6264ede2 Mon Sep 17 00:00:00 2001 From: DeDe Morton Date: Mon, 11 Sep 2017 13:18:08 -0700 Subject: [PATCH] [Docs] Add option to log messages in JSON (#4931) * [Docs] Add option to log messages in JSON * Add logging.files.permissions to full reference yml file Edit description of file permissions --- auditbeat/auditbeat.reference.yml | 4 ++++ filebeat/filebeat.reference.yml | 4 ++++ heartbeat/heartbeat.reference.yml | 4 ++++ libbeat/_meta/config.reference.yml | 4 ++++ libbeat/docs/loggingconfig.asciidoc | 32 +++++++++++++++++------------ metricbeat/metricbeat.reference.yml | 4 ++++ packetbeat/packetbeat.reference.yml | 4 ++++ winlogbeat/winlogbeat.reference.yml | 4 ++++ 8 files changed, 47 insertions(+), 13 deletions(-) diff --git a/auditbeat/auditbeat.reference.yml b/auditbeat/auditbeat.reference.yml index 2e3a127379c..7ad40e0c424 100644 --- a/auditbeat/auditbeat.reference.yml +++ b/auditbeat/auditbeat.reference.yml @@ -813,5 +813,9 @@ logging.files: # 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 + # Set to true to log messages in json format. #logging.json: false diff --git a/filebeat/filebeat.reference.yml b/filebeat/filebeat.reference.yml index 1bd319ca0fc..11f0fe833be 100644 --- a/filebeat/filebeat.reference.yml +++ b/filebeat/filebeat.reference.yml @@ -1233,5 +1233,9 @@ logging.files: # 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 + # Set to true to log messages in json format. #logging.json: false diff --git a/heartbeat/heartbeat.reference.yml b/heartbeat/heartbeat.reference.yml index e17e962120e..ac73a44c4f1 100644 --- a/heartbeat/heartbeat.reference.yml +++ b/heartbeat/heartbeat.reference.yml @@ -962,5 +962,9 @@ logging.files: # 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 + # Set to true to log messages in json format. #logging.json: false diff --git a/libbeat/_meta/config.reference.yml b/libbeat/_meta/config.reference.yml index 28bf014bbb4..8f69c25573d 100644 --- a/libbeat/_meta/config.reference.yml +++ b/libbeat/_meta/config.reference.yml @@ -748,5 +748,9 @@ logging.files: # 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 + # Set to true to log messages in json format. #logging.json: false diff --git a/libbeat/docs/loggingconfig.asciidoc b/libbeat/docs/loggingconfig.asciidoc index 3383f0c2d59..5ed329723a9 100644 --- a/libbeat/docs/loggingconfig.asciidoc +++ b/libbeat/docs/loggingconfig.asciidoc @@ -40,12 +40,12 @@ the logging output configuration from the command line. See You can specify the following options in the `logging` section of the +{beatname_lc}.yml+ config file: [float] -==== `to_syslog` +==== `logging.to_syslog` When true, writes all logging output to the syslog. [float] -==== `to_files` +==== `logging.to_files` When true, writes all logging output to files. The log files are automatically rotated when the log file size limit is reached. @@ -56,7 +56,7 @@ there will be no log file in the directory specified for logs. [float] [[level]] -==== `level` +==== `logging.level` Minimum log level. One of `debug`, `info`, `warning`, `error`, or `critical`. The default log level is `info`. @@ -79,7 +79,7 @@ that are published. Also logs any warnings, errors, or critical errors. [float] [[selectors]] -==== `selectors` +==== `logging.selectors` The list of debugging-only selector tags used by different Beats components. Use `*` to enable debug output for all components. For example add `publish` to display @@ -88,7 +88,7 @@ selectors can be overwritten using the `-d` command line option (`-d` also sets the debug log level). [float] -==== `metrics.enabled` +==== `logging.metrics.enabled` If enabled, {beatname_uc} periodically logs its internal metrics that have changed in the last period. For each metric that changed, the delta from the @@ -107,48 +107,54 @@ metrics and for this reason they are also not documented. [float] -==== `metrics.period` +==== `logging.metrics.period` The period after which to log the internal metrics. The default is 30s. [float] -==== `files.path` +==== `logging.files.path` The directory that log files are written to. The default is the logs path. See the <> section for details. [float] -==== `files.name` +==== `logging.files.name` The name of the file that logs are written to. By default, the name of the Beat is used. [float] -==== `files.rotateeverybytes` +==== `logging.files.rotateeverybytes` The maximum size of a log file. If the limit is reached, a new log file is generated. The default size limit is 10485760 (10 MB). [float] -==== `files.keepfiles` +==== `logging.files.keepfiles` The number of most recent rotated log files to keep on disk. Older files are deleted during log rotation. The default value is 7. The `keepfiles` options has to be in the range of 2 to 1024 files. [float] -==== `files.permissions` +==== `logging.files.permissions` -The permission mask to apply when rotating log files. The default value is 0600. The - `permissions` options must be a valid Unix-style file permissions mask expressed +The permissions mask to apply when rotating log files. The default value is 0600. The + `permissions` option must be a valid Unix-style file permissions mask expressed in octal notation. In Go, numbers in octal notation must start with '0'. Examples: + * 0644: give read and write access to the file owner, and read access to all others. * 0600: give read and write access to the file owner, and no access to all others. * 0664: give read and write access to the file owner and members of the group associated with the file, as well as read access to all other users. +[float] +==== `logging.json` + +When true, logs messages in JSON format. The default is false. + [float] === Logging format diff --git a/metricbeat/metricbeat.reference.yml b/metricbeat/metricbeat.reference.yml index 12766fa9a2b..0a9a09b6fa1 100644 --- a/metricbeat/metricbeat.reference.yml +++ b/metricbeat/metricbeat.reference.yml @@ -1192,5 +1192,9 @@ logging.files: # 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 + # Set to true to log messages in json format. #logging.json: false diff --git a/packetbeat/packetbeat.reference.yml b/packetbeat/packetbeat.reference.yml index 0beec09d542..633549190e5 100644 --- a/packetbeat/packetbeat.reference.yml +++ b/packetbeat/packetbeat.reference.yml @@ -1200,5 +1200,9 @@ logging.files: # 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 + # Set to true to log messages in json format. #logging.json: false diff --git a/winlogbeat/winlogbeat.reference.yml b/winlogbeat/winlogbeat.reference.yml index 4454e8b44d7..6d2a0570081 100644 --- a/winlogbeat/winlogbeat.reference.yml +++ b/winlogbeat/winlogbeat.reference.yml @@ -777,5 +777,9 @@ logging.files: # 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 + # Set to true to log messages in json format. #logging.json: false