Craig,

I changed the syslog-ng configuration to

destination d_jffnms {
        pipe ("/tmp/mysql.pipe"
        template("INSERT INTO syslog (date, date_logged, host, message) 
VALUES ('$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC', NOW\(\), '$FULLHOST', '$MSG');
\n")
        template-escape(yes));
};

And see the right syntax in /tmp/mysql.pipe

When I start:
mysql -u jffnms --password=**** jffnms < /tmp/mysql.pipe

I see the messages appear in the database.


In the syslog-ng example configuration I see a destination
destination jffnms_processing {
        program ("mysql -u jffnms -p**** jffnms < /tmp/mysql.pipe");
};

but this destination isn't used in a log-section.
So I thought, what the heck, let's change the destination d_jffnms to
destination d_jffnms {
        pipe ("/tmp/mysql.pipe"
        template("INSERT INTO syslog (date, date_logged, host, message) 
VALUES ('$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC', NOW\(\), '$FULLHOST', '$MSG');
\n")
        template-escape(yes));
        program ("mysql -u jffnms -p**** jffnms < /tmp/mysql.pipe");
};

And voila, the messages are appearing in the database :-)

Thanks for pointing me in the right direction, I'm still in the Linux 
learning phase :-)

regards,
Ruud


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
jffnms-users mailing list
jffnms-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jffnms-users

Reply via email to