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

Merged
merged 14 commits into from
Feb 5, 2025

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 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

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

@jestabro
Copy link
Contributor

Note that the smoketest test_console raises errors, although it passes as unittest.

smoketest/scripts/cli/base_vyostest_shim.py Dismissed Show dismissed Hide dismissed
@c-po
Copy link
Member Author

c-po commented Feb 2, 2025

Note that the smoketest test_console raises errors, although it passes as unittest.

Thank you - issue fixed in commit 9212b40

c-po added 9 commits February 3, 2025 07:16
Should be added as runtime option similar to "terminal monitor" known from
other vendors.
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
c-po added 5 commits February 4, 2025 18:09
Rsyslog supports individual VRFs per omfwd remote entry - so we should support
this, too.
Some systemd services are re-used over multiple configuration files. Keep a
single source of the real systemd names and only reference them by dictionary
keys.
Copy link

github-actions bot commented Feb 4, 2025

CI integration 👍 passed!

Details

CI logs

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

@c-po c-po merged commit c40ff64 into vyos:current Feb 5, 2025
14 of 16 checks passed
@c-po c-po deleted the syslog-T6989 branch February 5, 2025 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants