diff --git a/defaults/main.yml b/defaults/main.yml index b28823d..a207179 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -76,8 +76,11 @@ elastic_metricbeat_kibana_port: '{{ elastic_beats_kibana_port }}' elastic_metricbeat_kibana_basic_auth_username: '{{ elastic_beats_kibana_basic_auth_username }}' elastic_metricbeat_kibana_basic_auth_password: '{{ elastic_beats_kibana_basic_auth_password }}' elastic_metricbeat_beat_name: '{{ hostname }}' -elastic_metricbeat_compression_level: 5 +elastic_metricbeat_output_elasticsearch_compression_level: 5 elastic_metricbeat_index: metricbeat-%{[agent.version]}-%{+yyyy.MM.dd} +elastic_metricbeat_output_elasticsearch_workers: 1 +elastic_metricbeat_output_elasticsearch_bulk_max_size: 50 elastic_metricbeat_template_enabled: 'true' elastic_metricbeat_template_name: metricbeat elastic_metricbeat_template_pattern: metricbeat-* +elastic_metricbeat_max_procs: 4 diff --git a/templates/filebeat.yml.j2 b/templates/filebeat.yml.j2 index 9373644..a94fb97 100644 --- a/templates/filebeat.yml.j2 +++ b/templates/filebeat.yml.j2 @@ -14,8 +14,11 @@ setup.template.name: '{{ elastic_filebeat_template_name }}' setup.template.pattern: '{{ elastic_filebeat_template_pattern }}' output.elasticsearch: - hosts: - {{ elastic_filebeat_elasticsearch_hosts | to_yaml | indent(4) }} + hosts: {{ elastic_filebeat_elasticsearch_hosts | to_yaml }} + {% if elastic_filebeat_elasticsearch_username is defined %}username: {{ elastic_filebeat_elasticsearch_username }}{% endif%} + + {% if elastic_filebeat_elasticsearch_password is defined %}password: {{ elastic_filebeat_elasticsearch_password }}{% endif%} + compression_level: {{ elastic_filebeat_compression_level }} index: {{ elastic_filebeat_index }} diff --git a/templates/heartbeat.yml.j2 b/templates/heartbeat.yml.j2 index 72a7a9b..660188b 100644 --- a/templates/heartbeat.yml.j2 +++ b/templates/heartbeat.yml.j2 @@ -13,8 +13,11 @@ setup.template.name: '{{ elastic_heartbeat_template_name }}' setup.template.pattern: '{{ elastic_heartbeat_template_pattern }}' output.elasticsearch: - hosts: - {{ elastic_heartbeat_elasticsearch_hosts | to_yaml | indent(4) }} + hosts: {{ elastic_heartbeat_elasticsearch_hosts | to_yaml }} + {% if elastic_heartbeat_elasticsearch_username is defined %}username: {{ elastic_heartbeat_elasticsearch_username }}{% endif%} + + {% if elastic_heartbeat_elasticsearch_password is defined %}password: {{ elastic_heartbeat_elasticsearch_password }}{% endif%} + compression_level: {{ elastic_heartbeat_compression_level }} index: {{ elastic_heartbeat_index }} diff --git a/templates/metricbeat.yml.j2 b/templates/metricbeat.yml.j2 index 2592598..d77cf64 100644 --- a/templates/metricbeat.yml.j2 +++ b/templates/metricbeat.yml.j2 @@ -1,5 +1,8 @@ name: '{{ elastic_metricbeat_beat_name }}' +logging.level: info +logging.metrics.enabled: true + {% if elastic_metricbeat_kibana_enabled %} setup.kibana.host: '{{ elastic_metricbeat_kibana_protocol }}://{% if elastic_metricbeat_kibana_basic_auth_username %}{{ elastic_metricbeat_kibana_basic_auth_username }}:{{ elastic_metricbeat_kibana_basic_auth_password }}@{% endif %}{{ elastic_metricbeat_kibana_host }}:{{ elastic_metricbeat_kibana_port }}' setup.kibana.protocol: '{{ elastic_metricbeat_kibana_protocol }}' @@ -14,13 +17,20 @@ setup.template.name: '{{ elastic_metricbeat_template_name }}' setup.template.pattern: '{{ elastic_metricbeat_template_pattern }}' output.elasticsearch: - hosts: - {{ elastic_metricbeat_elasticsearch_hosts | to_yaml | indent(4) }} - compression_level: {{ elastic_metricbeat_compression_level }} + hosts: {{ elastic_metricbeat_elasticsearch_hosts | to_yaml }} + {% if elastic_metricbeat_elasticsearch_username is defined %}username: {{ elastic_metricbeat_elasticsearch_username }}{% endif%} + + {% if elastic_metricbeat_elasticsearch_password is defined %}password: {{ elastic_metricbeat_elasticsearch_password }}{% endif%} + + compression_level: {{ elastic_metricbeat_output_elasticsearch_compression_level }} index: {{ elastic_metricbeat_index }} + workers: {{ elastic_metricbeat_output_elasticsearch_workers }} + bulk_max_size: {{ elastic_metricbeat_output_elasticsearch_bulk_max_size }} xpack.monitoring: enabled: true metricbeat.modules: {{ elastic_metricbeat_modules | to_yaml | indent(2) }} + +max_procs: {{ elastic_metricbeat_max_procs }}