Exposed beat logging levels

The elastic beats are currently deployed with a default logging level of
info, which can produce large amounts of data, particularly in the
case that beats are monitoring one another's logs, and then logging this fact.
This commit exposes the configuration, allowing it to be set by the
variable log_level. The default level is unchanged.

Change-Id: Idbf715fc99450003920a45323123fcba919f2a83
This commit is contained in:
Duncan Martin Walker 2020-02-13 14:36:35 +00:00
parent bfedb5da0d
commit 81ab7008e1
13 changed files with 33 additions and 8 deletions

View File

@ -28,3 +28,7 @@ ilm_policy_file_location: "{{ (auditbeat_ilm_policy_file_location | default(defa
# beat processors. Empty dictionary sets `add_host_metadata: ~`
processors: {}
# Logging level
# Available log levels are error, warning, info, debug
auditbeat_log_level: "{{ elastic_beat_log_level | default('info') }}"

View File

@ -842,7 +842,7 @@ setup.ilm.policy_file: "{{ ilm_policy_file_location }}/{{ ilm_policy_filename }}
{% endif %}
#================================ Logging ======================================
{{ elk_macros.beat_logging('auditbeat') }}
{{ elk_macros.beat_logging('auditbeat', auditbeat_log_level) }}
#============================== Xpack Monitoring =====================================
{{ elk_macros.xpack_monitoring_elasticsearch(inventory_hostname, elasticsearch_data_hosts, ansible_processor_count) }}

View File

@ -296,3 +296,7 @@ ilm_policy_file_location: "{{ (filebeat_ilm_policy_file_location | default(defau
# beat processors. Empty dictionary sets `add_host_metadata: ~`
processors: {}
# Logging level
# Available log levels are error, warning, info, debug
filebeat_log_level: "{{ elastic_beat_log_level | default('info') }}"

View File

@ -1381,7 +1381,7 @@ setup.ilm.policy_file: "{{ ilm_policy_file_location }}/{{ ilm_policy_filename }}
{{ elk_macros.setup_kibana(hostvars[groups['kibana'][0]]['ansible_host'] ~ ':' ~ kibana_port) }}
{% endif %}
#================================ Logging ======================================
{{ elk_macros.beat_logging('filebeat') }}
{{ elk_macros.beat_logging('filebeat', filebeat_log_level) }}
#============================== Xpack Monitoring =====================================
{{ elk_macros.xpack_monitoring_elasticsearch(inventory_hostname, elasticsearch_data_hosts, ansible_processor_count) }}

View File

@ -28,3 +28,7 @@ ilm_policy_file_location: "{{ (heartbeat_ilm_policy_file_location | default(defa
# beat processors. Empty dictionary sets `add_host_metadata: ~`
processors: {}
# Logging level
# Available log levels are error, warning, info, debug
heartbeat_log_level: "{{ elastic_beat_log_level | default('info') }}"

View File

@ -1024,7 +1024,7 @@ setup.ilm.policy_file: "{{ ilm_policy_file_location }}/{{ ilm_policy_filename }}
{% endif %}
#================================ Logging ======================================
{{ elk_macros.beat_logging('heartbeat') }}
{{ elk_macros.beat_logging('heartbeat', heartbeat_log_level) }}
#============================== Xpack Monitoring =====================================
{{ elk_macros.xpack_monitoring_elasticsearch(inventory_hostname, elasticsearch_data_hosts, ansible_processor_count) }}

View File

@ -28,3 +28,7 @@ ilm_policy_file_location: "{{ (journalbeat_ilm_policy_file_location | default(de
# beat processors. Empty dictionary sets `add_host_metadata: ~`
processors: {}
# Logging level
# Available log levels are error, warning, info, debug
journalbeat_log_level: "{{ elastic_beat_log_level | default('info') }}"

View File

@ -780,7 +780,7 @@ setup.ilm.policy_file: "{{ ilm_policy_file_location }}/{{ ilm_policy_filename }}
{% endif %}
#================================ Logging ======================================
{{ elk_macros.beat_logging('journalbeat') }}
{{ elk_macros.beat_logging('journalbeat', journalbeat_log_level) }}
#============================== Xpack Monitoring =====================================
{{ elk_macros.xpack_monitoring_elasticsearch(inventory_hostname, elasticsearch_data_hosts, ansible_processor_count) }}

View File

@ -39,3 +39,7 @@ ilm_policy_file_location: "{{ (metricbeat_ilm_policy_file_location | default(def
# beat processors. Empty dictionary sets `add_host_metadata: ~`
processors: {}
# Logging level
# Available log levels are error, warning, info, debug
metricbeat_log_level: "{{ elastic_beat_log_level | default('info') }}"

View File

@ -1501,7 +1501,7 @@ setup.ilm.policy_file: "{{ ilm_policy_file_location }}/{{ ilm_policy_filename }}
{% endif %}
#================================ Logging ======================================
{{ elk_macros.beat_logging('metricbeat') }}
{{ elk_macros.beat_logging('metricbeat', metricbeat_log_level) }}
#============================== Xpack Monitoring =====================================
{{ elk_macros.xpack_monitoring_elasticsearch(inventory_hostname, elasticsearch_data_hosts, ansible_processor_count) }}

View File

@ -29,5 +29,10 @@ ilm_policy_file_location: "{{ (packetbeat_ilm_policy_file_location | default(def
# beat processors. Empty dictionary sets `add_host_metadata: ~`
processors: {}
# optional list of ports to ignore
packetbeat_ignored_ports: []
# Logging level
# Available log levels are error, warning, info, debug
packetbeat_log_level: "{{ elastic_beat_log_level | default('info') }}"

View File

@ -1216,7 +1216,7 @@ setup.ilm.policy_file: "{{ ilm_policy_file_location }}/{{ ilm_policy_filename }}
{% endif %}
#================================ Logging ======================================
{{ elk_macros.beat_logging('packetbeat') }}
{{ elk_macros.beat_logging('packetbeat', packetbeat_log_level) }}
#============================== Xpack Monitoring =====================================
{{ elk_macros.xpack_monitoring_elasticsearch(inventory_hostname, elasticsearch_data_hosts, ansible_processor_count) }}

View File

@ -360,13 +360,13 @@ setup.kibana:
#ssl.curve_types: []
{%- endmacro %}
{% macro beat_logging(beat_name) -%}
{% macro beat_logging(beat_name, log_level='info') -%}
# There are four options for the log output: file, stderr, syslog, eventlog
# The file output is the default.
# Sets log level. The default log level is info.
# Available log levels are: error, warning, info, debug
#logging.level: info
logging.level: {{ log_level }}
# Enable debug output for selected components. To enable all selectors use ["*"]
# Other available selectors are "beat", "publish", "service"