Skip to content

Instantly share code, notes, and snippets.

@tomquisel
Last active November 17, 2015 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomquisel/c9a82fcea12da63230ae to your computer and use it in GitHub Desktop.
Save tomquisel/c9a82fcea12da63230ae to your computer and use it in GitHub Desktop.
How to direct logs to a file based on tag in rsyslogd

How to direct logs to a file using a logger tag

ls /etc/rsyslog.d/

20-ufw.conf  21-cloudinit.conf  50-default.conf  60-etl.conf  postfix.conf

cat /etc/rsyslog.d/60-etl.conf

:syslogtag, isequal, "claims_etl:" /var/log/etl/claims.log

Once you've created that file, you need to:

sudo mkdir /var/log/etl/
sudo touch /var/log/etl/claims.log
sudo chown -R syslog:syslog /var/log/etl/
sudo service rsyslog restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment