%msg% has an extra space

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

%msg% has an extra space

Postby egene on Thu Jun 05, 2008 10:10 pm

Sorry, but I have another question. I added the following to my rsyslog.conf:

$template dummy,"[%msg%]\n"
*.* /var/log/dummy; dummy

I then ran the command:

logger "test"

In the file /var/log/dummy, I see
[ test]

Should that extra space be there?

Thanks,
Elizabeth
egene
Avarage
 
Posts: 14
Joined: Thu Jun 05, 2008 8:07 pm

Professional Services Information

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

Re: %msg% has an extra space

Postby rgerhards on Fri Jun 06, 2008 8:44 am

Indeed, it should. That's an artifact of RFC 3164 based parsing. The first character immediately after the TAG is already part of MSG. It is not a space-delimited field. As a consequence, most of the MSGs start with a blank.

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

Re: %msg% has an extra space

Postby egene on Fri Jun 06, 2008 1:44 pm

Thanks for your response. My workaround is to add a dummy field at the front of my message so I start using my data from the second delimited field.
egene
Avarage
 
Posts: 14
Joined: Thu Jun 05, 2008 8:07 pm

Google Ads



Return to Configuration

Who is online

Users browsing this forum: No registered users and 0 guests

cron