Use legacy rsyslog selector syntax to write every authpriv priority to /var/log/secure.
Which configuration line is appropriate?
The legacy form is facility.priority action; authpriv.* selects every priority for authpriv.
Detailed explanation
authpriv.none /var/log/secureIncorrect. none excludes the facility.
Incorrect. none excludes the facility.
*.authpriv /var/log/secureIncorrect. Facility and priority are in the wrong order.
Incorrect. Facility and priority are in the wrong order.
authpriv.* /var/log/secureCorrect. authpriv.* routes every authpriv priority to the file.
Correct. authpriv.* routes every authpriv priority to the file.
authpriv=/var/log/secureIncorrect. It is not legacy selector syntax.
Incorrect. It is not legacy selector syntax.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' 'authpriv.* /var/log/secure' | awk '{print "selector="$1, "action="$2}'Expected result
selector=authpriv.* action=/var/log/secureKey points
- facility.priority
- * means all priorities
- Action is output
Notes
- Environment: awk / 合成rsyslog行
- 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.