Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0


## [Unreleased]
### Added
- [SERVICES] [RSYSLOGD] Output queues in default rulesets


## [2.34.4] - 2025-12-17
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ lookup_table(name="{{f_reputation_ctx.reputation_ctx.filename}}" file="{{f_reput

{{ frontend.pre_ruleset }}

ruleset(name="{{ frontend.ruleset_name }}_outputs" queue.type="Direct") {
{{ frontend.log_condition }}
}

ruleset(name="{{ frontend.ruleset_name }}_outputs_garbage" queue.type="Direct") {
{{ frontend.log_condition_failure }}
}

{% if frontend.rendered_custom_actions -%}
ruleset(name="{{ frontend.ruleset_name }}_custom_actions" queue.type="Direct") {
{{ frontend.rendered_custom_actions|indent(4, false) }}
Expand Down Expand Up @@ -91,11 +99,10 @@ ruleset(name="{{ frontend.ruleset_name }}" {{ frontend.ruleset_options|safe }})

{{ frontend.log_condition }}

action(type="omfile" DynaFile="recoveryfile" CreateDirs="on" action.ExecOnlyWhenPreviousIsSuspended="on" template="raw_message")
call {{ frontend.ruleset_name }}_outputs
Comment on lines 92 to +102
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't keep {{ frontend.log_condition }} if you call the outputs ruleset with the same action inside

stop
} else {
{{ frontend.log_condition_failure }}
#We need at least a directive here - to prevent rsyslog error
call {{ frontend.ruleset_name }}_outputs_garbage
stop
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@
}]
}-%}

ruleset(name="{{ frontend.ruleset_name }}_outputs" queue.type="Direct") {
{{ frontend.log_condition|indent(4, false) }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this one indented? (and not the other?)

}

ruleset(name="{{ frontend.ruleset_name }}_outputs_garbage" queue.type="Direct") {
action(type="omfile"
File="/var/log/haproxy/{{frontend.name}}.log"
# FIXME : Add dirOwner, dirGroup, fileOwner, fileGroup, dirCreateMode, fileCreateMode
flushInterval="1"
asyncWriting="on")
}

{% if frontend.rendered_custom_actions -%}
ruleset(name="{{ frontend.ruleset_name }}_custom_actions" queue.type="Direct") {
{{ frontend.rendered_custom_actions|indent(4, false) }}
Expand Down Expand Up @@ -112,25 +124,17 @@ ruleset(name="{{ frontend.ruleset_name }}" {{ frontend.ruleset_options|safe }})
cache_size="{{frontend.mmdb_cache_size}}")
{%- endif %}

set $!frontend_name = "{{frontend.name}}";

Comment on lines -115 to -116
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you remove this?

# Convert timestamp from epoch to rfc3339
set $!timestamp = replace(format_time(field($!time, ".", 1), "date-rfc3339"), "Z", "." & field($!time, ".", 2) & "Z");

{% if frontend.rendered_custom_actions %}call {{ frontend.ruleset_name }}_custom_actions{% endif %}

{% include "rsyslog_darwin/ruleset.conf" %}

{{ frontend.log_condition }}

call {{ frontend.ruleset_name }}_outputs
stop

# If other logs
} else {
action(type="omfile"
File="/var/log/haproxy/{{frontend.name}}.log"
# FIXME : Add dirOwner, dirGroup, fileOwner, fileGroup, dirCreateMode, fileCreateMode
flushInterval="1"
asyncWriting="on")
call {{ frontend.ruleset_name }}_outputs_garbage
stop
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@
}]
}-%}

ruleset(name="{{ frontend.ruleset_name }}_outputs" queue.type="Direct") {
{{ frontend.log_condition }}
}

ruleset(name="{{ frontend.ruleset_name }}_outputs_garbage" queue.type="Direct") {
action(type="omfile"
File="/var/log/haproxy/{{frontend.name}}.log"
# FIXME : Add dirOwner, dirGroup, fileOwner, fileGroup, dirCreateMode, fileCreateMode
flushInterval="1"
asyncWriting="on")
}

{% if frontend.rendered_custom_actions -%}
ruleset(name="{{ frontend.ruleset_name }}_custom_actions" queue.type="Direct") {
{{ frontend.rendered_custom_actions|indent(4, false) }}
Expand Down Expand Up @@ -92,20 +104,17 @@ ruleset(name="{{ frontend.ruleset_name }}" {{ frontend.ruleset_options|safe }})
cache_size="{{frontend.mmdb_cache_size}}")
{%- endif %}

# Convert timestamp from epoch to rfc3339
set $!timestamp = replace(format_time(field($!time, ".", 1), "date-rfc3339"), "Z", "." & field($!time, ".", 2) & "Z");

Comment on lines +107 to +109
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this done here?

{% if frontend.rendered_custom_actions %}call {{ frontend.ruleset_name }}_custom_actions{% endif %}

{% include "rsyslog_darwin/ruleset.conf" %}

{{ frontend.log_condition }}

call {{ frontend.ruleset_name }}_outputs
stop

# If other logs
} else {
action(type="omfile"
File="/var/log/haproxy/{{frontend.name}}.log"
# FIXME : Add dirOwner, dirGroup, fileOwner, fileGroup, dirCreateMode, fileCreateMode
flushInterval="1"
asyncWriting="on")
call {{ frontend.ruleset_name }}_outputs_garbage
stop
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@

{{ frontend.pre_ruleset }}

ruleset(name="{{ frontend.ruleset_name }}_outputs" queue.type="Direct") {
{{ frontend.log_condition|indent(4, false) }}
}

ruleset(name="{{ frontend.ruleset_name }}_outputs_garbage" queue.type="Direct") {
{{ frontend.log_condition_failure|indent(4, false) }}
}
Comment on lines +15 to +17
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is never used


{% if frontend.rendered_custom_actions -%}
ruleset(name="{{ frontend.ruleset_name }}_custom_actions" queue.type="Direct") {
{{ frontend.rendered_custom_actions|indent(4, false) }}
Expand All @@ -23,9 +31,7 @@ ruleset(name="{{ frontend.ruleset_name }}" {{ frontend.ruleset_options|safe }})

{% include "rsyslog_darwin/ruleset.conf" %}

{{ frontend.log_condition }}

action(type="omfile" DynaFile="recoveryfile" CreateDirs="on" action.ExecOnlyWhenPreviousIsSuspended="on" template="raw_message")
call {{ frontend.ruleset_name }}_outputs
stop

}