From 75061c4d78c29bf9de1d7d8607fc290995476713 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Mon, 15 Sep 2025 07:55:43 -0500 Subject: [PATCH] all: Split up Fluent Bit vars Instead of defining the common values for Fluent bit inputs, filters, and outputs directly in the variables used by the _fluent-bit_ role, we need to split these into reusable pieces. This way, hosts and groups that need to use a slightly different pipeline configuration can access the default values without having to redefine them. --- group_vars/all.yml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/group_vars/all.yml b/group_vars/all.yml index e34d219..2a6aa74 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -142,7 +142,7 @@ dnf_automatic_schedule: >- | string }} *-*-* 04:00:00 America/Chicago -fluent_bit_filters: +fluent_bit_default_filters: # Avoid log amplification from logging the result of sending logs! - name: grep match: host.fluent-bit.service @@ -175,21 +175,28 @@ fluent_bit_filters: - message - tags - topic -fluent_bit_outputs: -- name: http - alias: victorialogs - match: host.* + +fluent_bit_filters: '{{ fluent_bit_default_filters }}' + +fluent_bit_output_template_victorialogs: host: logs.pyrocufflink.blue port: 443 tls: true tls.verify: true tls.verify_hostname: true tls.ca_file: /etc/pki/ca-trust/source/anchors/dch-root-ca-r2.crt - uri: /insert/jsonline?_stream_fields=hostname,systemd_unit&_msg_field=message&_time_field=date format: json_lines json_date_format: iso8601 log_response_payload: false -- name: http + +fluent_bit_output_systemd: + name: http + alias: victorialogs + match: host.* + uri: /insert/jsonline?_stream_fields=hostname,systemd_unit&_msg_field=message&_time_field=date + +fluent_bit_output_ntfy: + name: http alias: ntfy workers: 1 match: ntfy @@ -202,3 +209,9 @@ fluent_bit_outputs: format: json_lines json_date_key: false log_response_payload: false + +fluent_bit_main_outputs: +- '{{ fluent_bit_output_systemd | combine(fluent_bit_output_template_victorialogs) }}' +- '{{ fluent_bit_output_ntfy }}' + +fluent_bit_outputs: '{{ fluent_bit_main_outputs }}'