-
Notifications
You must be signed in to change notification settings - Fork 10
add(services): output queues in default rulesets #606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,18 @@ | |
| }] | ||
| }-%} | ||
|
|
||
| ruleset(name="{{ frontend.ruleset_name }}_outputs" queue.type="Direct") { | ||
| {{ frontend.log_condition|indent(4, false) }} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) }} | ||
|
|
@@ -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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
|---|---|---|
|
|
@@ -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) }} | ||
|
|
@@ -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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
|---|---|---|
|
|
@@ -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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) }} | ||
|
|
@@ -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 | ||
|
|
||
| } | ||
There was a problem hiding this comment.
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