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: T6989: convert old configuration format to "advanced" #4305

Open
wants to merge 11 commits into
base: current
Choose a base branch
from

Conversation

c-po
Copy link
Member

@c-po c-po commented Jan 15, 2025

Change summary

We are still using the legacy config format for rsyslog in https://github.com/vyos/vyos-1x/blob/bb4611544ff73a979f927a7a1c8ea3dd1c56fb48/data/templates/rsyslog/rsyslog.conf.j2

It has been superseded by a new format:

https://www.rsyslog.com/doc/configuration/converting_to_new_format.html

There are some associated issues. For example, we use $markMessagePeriod for set system syslog global marker interval, which sends mark messages unconditionally. New rsyslog versions support sending mark messages only if there are no real messages, the old directive is now listed as obsolete (https://www.rsyslog.com/doc/configuration/input_directives/rsconf1_markmessageperiod.html) and its replacement seems to be only available in the advanced format.

  • Drop file CLI option to log to dedicated files.
  • Drop user CLI option to always log to user terminal - should be an op-mode command instead
  • Rename host <ipv4|ipv6|fqdn> -> remote <ipv4|ipv6|fqdn>
  • Add new source-address option for outgoing connections under remote source-address <ipv4|ipv6|fqdn>
  • VRF can be defined per remote as remote vrf <name>
  • Move global preserve-fqdn -> preserve-fqdn - move up one CLI level
  • Move global marker interval -> marker interval - move up one CLI level
  • Rename global -> local as every facility configured under global is actually logged locally to /var/log/messages

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)

Related PR(s)

How to test / Smoketest result

vyos@vyos:~$ /usr/libexec/vyos/tests/smoke/cli/test_system_syslog.py
test_console (__main__.TestRSYSLOGService.test_console) ... ok
test_global (__main__.TestRSYSLOGService.test_global) ... ok
test_remote (__main__.TestRSYSLOGService.test_remote) ... ok
test_vrf_source_address (__main__.TestRSYSLOGService.test_vrf_source_address) ... ok

----------------------------------------------------------------------
Ran 4 tests in 9.964s

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

Copy link

github-actions bot commented Jan 15, 2025

👍
No issues in PR Title / Commit Title

Copy link

github-actions bot commented Jan 15, 2025

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

@c-po c-po marked this pull request as draft January 15, 2025 20:37
@c-po c-po marked this pull request as ready for review January 16, 2025 20:32
@c-po c-po marked this pull request as draft January 17, 2025 07:18
c-po added 7 commits January 18, 2025 20:30
Move "global preserve-fqdn" one CLI level up, as it relates to all logging
targets (console, global and remote).
The previously "global" options actually were only relevant for the local
logging to /var/log/messages.
This is a feature that worked decades ago when logs were small and reviewed by
a human, it fails badly on high volume logs processed by tools.

https://www.rsyslog.com/doc/configuration/action/rsconf1_repeatedmsgreduction.html
Rsyslog supports individual VRFs per omfwd remote entry - so we should support
this, too.
@c-po c-po marked this pull request as ready for review January 18, 2025 19:58
data/templates/rsyslog/rsyslog.conf.j2 Outdated Show resolved Hide resolved
@c-po c-po requested a review from dmbaturin January 20, 2025 20:06
Copy link

CI integration ❌ failed!

Details

CI logs

  • CLI Smoketests (no interfaces) ❌ failed
  • CLI Smoketests (interfaces only) ❌ failed
  • Config tests 👍 passed
  • RAID1 tests 👍 passed
  • TPM tests 👍 passed

Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

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.

2 participants