Skip to content

Instantly share code, notes, and snippets.

@sowamazing
Created October 28, 2014 17:30
Show Gist options
  • Save sowamazing/93309591fb292395fcd7 to your computer and use it in GitHub Desktop.
Save sowamazing/93309591fb292395fcd7 to your computer and use it in GitHub Desktop.
Sending JSON Format Logs From Syslog-ng - Snippet 1
parser p_db {
db-parser(file("/etc/syslog-ng/ssh.xml"));
};
template LogglyFormat { template("<${PRI}>1 ${ISODATE} ${HOST} ${PROGRAM} ${PID} ${MSGID} [abcd1234-aaaa-bbbb-1234-1234abcd1234@41058] $MSG $(format_json --scope nv_pairs)\n");};
destination d_loggly { tcp("logs-01.loggly.com" port(514) template(LogglyFormat)); };
log { source(src); parser(p_db); destination(d_loggly); };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment