diff --git a/tasks/fluentd-client.yml b/tasks/fluentd-client.yml index 6d5f41be41f55c9cc6b6d311a39fd60a979a8a50..0b3f514cb87f2d37930471eb35c87f132c2cc386 100644 --- a/tasks/fluentd-client.yml +++ b/tasks/fluentd-client.yml @@ -42,6 +42,7 @@ - fluent-plugin-multi-format-parser - fluent-plugin-record-modifier - fluent-plugin-mail + - fluent-plugin-beats - name: Ensure SSL Directory file: diff --git a/templates/td-agent.conf b/templates/td-agent.conf index de77bb6614077ffe02e89f19435a324158ba424b..252a33a532a6cdcf16d285ad8b7586a2247e5eb0 100644 --- a/templates/td-agent.conf +++ b/templates/td-agent.conf @@ -2,6 +2,11 @@ @type forward port 24224 </source> + +<source> + @type beats + metadata_as_tag +</source> {% if 'proxyserver' in groups and inventory_hostname in groups.proxyserver %} <source> @@ -332,6 +337,27 @@ request_timeout 15s </match> +<match *beat> + @type elasticsearch_dynamic + logstash_format true + logstash_prefix ${tag_parts[0]} + type_name ${record['type']} + host 127.0.0.1 + port 9200 + user elastic + password {{ elasticsearch.users.elastic|default("") }} + include_tag_key true + tag_key @log_name + reconnect_on_error true + <buffer> + @type file + path /var/log/td-agent/buffer/beats.*.buffer + flush_at_shutdown true + flush_thread_count 8 + </buffer> + request_timeout 15s +</match> + <match **> @type elasticsearch logstash_format true