php-syslog-ng issue

This is the place for you, if you got rsyslog up and running but wonder how to make it do what you want.

Moderator: rgerhards

php-syslog-ng issue

Postby econ on Thu Nov 29, 2007 5:37 pm

I am currently using rsyslog with php-syslog-ng as my frontend. Everything works great but rsyslog puts values into mysql for fields "facility" and "priority". php-syslog-ng requires values in there instead of numbers. When numbers are entered it does not show the log entries correctly in the interface. Using the words resolve the issue.

example:

rsyslog puts "facility=0" and "priority=6" into logs
php-syslog-ng needs "facility=kern" and "priority=info" into logs.

How do i get rsyslog to enter the corresponding values instead of the numbers?

Thank you.
econ
New
 
Posts: 5
Joined: Thu Nov 29, 2007 5:31 pm

Professional Services Information

  • Custom written rsyslog.conf?
  • Maintenance Contract?
  • Installation support?

RE: php-syslog-ng issue

Postby rgerhards on Thu Nov 29, 2007 6:35 pm

I remember this, php-syslog-ng works with the nonstandard text variables. I've added extra properties for this some time ago. You need to change the fields used in the template. Do not use "syslogfacility" but "syslogfacility-text" instead. Same with "syslogseverity-text". That should do the trick.

Rainer
User avatar
rgerhards
Site Admin
 
Posts: 1780
Joined: Thu Feb 13, 2003 11:57 am

RE: php-syslog-ng issue

Postby econ on Thu Nov 29, 2007 7:29 pm

Tried changing the template with no success still puts numbers into the files.

This is what i have for my template specification:
$template syslog-ng,"insert into logs(host, facility, priority, tag, datetime, msg)values
('%HOSTNAME%', %syslogfacility-text%, %syslogpriority-text%, '%syslogtag%', '%timereported:::date-mysql%', '%msg%')", SQL

Does that look correct?
econ
New
 
Posts: 5
Joined: Thu Nov 29, 2007 5:31 pm

Postby econ on Thu Nov 29, 2007 9:21 pm

Same behavior put updated template:

$template syslog-ng,"insert into logs(host, facility, priority, level, tag, datetime, program, msg)values('%HOSTNAME%',
%syslogfacility-text%, %syslogpriority-text%, %syslogseverity-text%, '%syslogtag%', '%timereported:::date-mysql%',
%programname%, '%msg%')", SQL
econ
New
 
Posts: 5
Joined: Thu Nov 29, 2007 5:31 pm

Postby econ on Fri Dec 07, 2007 8:41 pm

Just wanted to report back and let everyone know that if you use the above statment and put single quotes around all the variables that have "-text" specified the template will work without any issues.
econ
New
 
Posts: 5
Joined: Thu Nov 29, 2007 5:31 pm

Google Ads



Return to Configuration

Who is online

Users browsing this forum: No registered users and 1 guest

cron