From the course: Cert Prep LPIC-1 Exam 102 (Version 5.0)

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Rsyslog actions

Rsyslog actions - Linux Tutorial

From the course: Cert Prep LPIC-1 Exam 102 (Version 5.0)

Start my 1-month free trial

Rsyslog actions

- [Instructor] For every filter, there's an action. The action for a log filter usually involves saving the log messages to a file. For instance, in the case of cron* /var/log/cron.log, all cron messages are saved to the var.log/cron.log file. As this line is written, this file is synchronized on every write. This can create a lot of overhead if there are a lot of writes to the log. To keep from syncing the file system every time the log is written, we can precede the path with a dash. Be aware that the data's held in RAM since it's not read to the disk right away. This opens the possibility that you may lose data if the server shuts down unexpectedly. Log save paths can either be static as we saw in our previous example or dynamic. With a dynamic path, we can create a template and then use that template name, prefixed with a question mark, in the rule. The template for this example might look like this. It will create a…

Contents