Skip to content
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

syslog: T5367: add format option to include timezone in message #4061

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

c-po
Copy link
Member

@c-po c-po commented Sep 12, 2024

Change Summary

Add CLI option to include the systems timezone in the syslog message sent to a collector.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Component(s) name

syslog

How to test

set system syslog host <hostname> format include-timezone

Smoketest result

[email protected]:~$ /usr/libexec/vyos/tests/smoke/cli/test_system_syslog.py
test_syslog_basic (__main__.TestRSYSLOGService.test_syslog_basic) ... ok

----------------------------------------------------------------------
Ran 1 test in 3.977s

OK

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Add CLI option to include the systems timezone in the syslog message sent to
a collector. This can be enabled using:

  set system syslog host <hostname> format include-timezone
Copy link

github-actions bot commented Sep 12, 2024

👍
No issues in PR Title / Commit Title

Copy link

✅ No issues found in unused-imports check.. Please refer the workflow run

@c-po c-po marked this pull request as ready for review September 15, 2024 09:59
@c-po c-po requested a review from a team as a code owner September 15, 2024 09:59
{{ tmp | join(';') }} @@(o){{ host_name | bracketize_ipv6 }}:{{ host_options.port }};RSYSLOG_SyslogProtocol23Format
{% else %}
{{ tmp | join(';') }} @@{{ host_name | bracketize_ipv6 }}:{{ host_options.port }}
{{ tmp | join(';') }} @@{{ '(o)' if host_options.format.octet_counted is vyos_defined }}{{ host_name | bracketize_ipv6 }}:{{ host_options.port }}{{ ';RSYSLOG_SyslogProtocol23Format' if host_options.format.include_timezone is vyos_defined }}
Copy link
Member

Choose a reason for hiding this comment

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

As I remember it could be not only for TCP

Copy link
Member Author

Choose a reason for hiding this comment

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

What exactly do you mean? Octet counting, or the message format?

Copy link
Member

Choose a reason for hiding this comment

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

I mean this check is vyos_defined('tcp')

{%         if host_options.protocol is vyos_defined('tcp') %}
{%             if host_options.format.octet_counted is vyos_defined %}
{{ tmp | join(';') }} @@{{ '(o)' if host_options.format.octet_counted is vyos_defined }}{{ host_name | bracketize_ipv6 }}:{{ host_options.port }}{{ ';RSYSLOG_SyslogProtocol23Format' if host_options.format.include_timezone is vyos_defined }}

But it is probably for another PR

@dmbaturin dmbaturin merged commit ac9f5b1 into vyos:current Sep 19, 2024
16 of 18 checks passed
@c-po c-po deleted the syslog-T5367 branch September 21, 2024 06:51
@c-po
Copy link
Member Author

c-po commented Sep 30, 2024

@Mergifyio backport sagitta circinus

Copy link
Contributor

mergify bot commented Sep 30, 2024

backport sagitta circinus

✅ Backports have been created

dmbaturin added a commit that referenced this pull request Sep 30, 2024
syslog: T5367: add format option to include timezone in message (backport #4061)
c-po added a commit that referenced this pull request Sep 30, 2024
syslog: T5367: add format option to include timezone in message (backport #4061)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants