Validate the main rsyslog configuration and included files without starting a daemon.
Which command is appropriate?
rsyslogd -N1 validates configuration and exits, allowing errors to be found before a restart or reload.
Detailed explanation
rsyslogd -HIncorrect. -H is not the standard level-1 validation option.
Incorrect. -H is not the standard level-1 validation option.
logger -N1Incorrect. logger sends messages and does not validate configuration.
Incorrect. logger sends messages and does not validate configuration.
journalctl -N1Incorrect. journalctl queries the journal.
Incorrect. journalctl queries the journal.
rsyslogd -N1Correct. -N1 performs the configuration check.
Correct. -N1 performs the configuration check.
Try it yourself
An example you can run in a temporary verification environment.
rsyslogd -h 2>&1 | grep -E -- '-N' | head -n 1Expected result
config validationに関するhelp行Key points
- -N1 validates
- Check before reload
- It does not stay resident
Notes
- Environment: rsyslogd help / 設定読込と起動なし
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.