Forward every facility and priority to log.example port 514 using legacy action syntax and TCP.
Which configuration line is appropriate?
In legacy rsyslog actions, @ is UDP and @@ is TCP for remote forwarding.
Detailed explanation
*.* @@log.example:514Correct. @@log.example:514 requests TCP forwarding for all selectors.
Correct. @@log.example:514 requests TCP forwarding for all selectors.
*.* @log.example:514Incorrect. A single @ denotes UDP in this syntax.
Incorrect. A single @ denotes UDP in this syntax.
@@.* log.example:514Incorrect. The selector and action syntax is malformed.
Incorrect. The selector and action syntax is malformed.
*.* /var/log/log.example:514Incorrect. It is a local file path, not a remote TCP action.
Incorrect. It is a local file path, not a remote TCP action.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' '*.* @@log.example:514' | awk '{print "selector="$1, "target="$2}'Expected result
selector=*.* target=@@log.example:514Key points
- @@ means TCP
- @ means UDP
- *.* means all messages
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.