diff --git a/playbooks/roles/filebeat/templates/filebeat_monitor.yaml b/playbooks/roles/filebeat/templates/filebeat_monitor.yaml index b686d2e..c78f277 100644 --- a/playbooks/roles/filebeat/templates/filebeat_monitor.yaml +++ b/playbooks/roles/filebeat/templates/filebeat_monitor.yaml @@ -2,6 +2,10 @@ project_id: {{ instance_name }} sublog: {{ log_type }} elastic_hosts: {{ filebeat_logs[log_type]['es_hosts'] }} elastic_indice_name: {{ filebeat_logs[log_type]['index_prefix'] }}-{{ instance_name }}-* +{%- if filebeat_logs[log_type]['es_user'] and filebeat_logs[log_type]['es_passwd'] -%} +elastic_username: {{ filebeat_logs[log_type]['es_user'] }} +elastic_password: {{ filebeat_logs[log_type]['es_passwd'] }} +{%- endif -%} elastic_search_lifecycle: {{ filebeat_monitor_lifecycle | default(30) }} http_unix_sock: {{ filebeat_monitor_sock | default('./filebeat_monitor.sock') }} prometheus_push_gateway_url: {{ filebeat_monitor_push_gateway | default('') }}