Skip to content

Instantly share code, notes, and snippets.

@faxm0dem
Created June 7, 2017 13:14
Show Gist options
  • Save faxm0dem/dcb343765ec912ba6b1b409041109e27 to your computer and use it in GitHub Desktop.
Save faxm0dem/dcb343765ec912ba6b1b409041109e27 to your computer and use it in GitHub Desktop.
syslog-ng log path flags
@version: 3.5
source s_in {
file("/tmp/in");
};
destination d_driver_position {
file("/tmp/driver_position.log");
};
destination d_all_but_driver_position {
file("/tmp/all_but_driver_position.log");
};
filter f_driver_position {
program("driver_position");
};
log {
source(s_in);
filter(f_driver_position);
destination(d_driver_position);
flags(final);
};
log {
source(s_in);
destination(d_all_but_driver_position);
};
@faxm0dem
Copy link
Author

faxm0dem commented Jun 7, 2017

1. run syslog-ng as non-privileged user:

rm /tmp/in /tmp/*driver_position.log /tmp/R /tmp/c; syslog-ng -R /tmp/R -c /tmp/c -f flags-final.conf -Fdv

2. send some entries to in

echo driver_position baz >> /tmp/in
echo foo bar baz >> /tmp/in

3. observe result in /tmp/*driver_position.log files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment