RSYSLOG v5 CONF not sending logs with applied template

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

Google Ads


RSYSLOG v5 CONF not sending logs with applied template

Postby kazanka101 » Wed Jan 03, 2018 2:32 pm

Hello,

I'm trying to get rsyslog to forward logs to a host with an applied template.

I have the following...

Code: Select all
$template defaultTemplate0, "<%PRI%>%TIMESTAMP% %FROMHOST% %syslogtag%%msg%\n"
$template defaultTemplate1, "<%PRI%>%TIMESTAMP% StaticHostname0 %syslogtag%%msg%\n"
$template defaultTemplate2, "<%PRI%>%TIMESTAMP% StaticHostname1 %syslogtag%%msg%\n"

if $fromhost-ip startswith '10.0.1.3' then @@10.0.1.2:514;defaultTemplate0
if $fromhost-ip startswith '10.0.1.4' then @@10.0.1.2:514;defaultTemplate2

& ~

*.* @@10.0.1.2:514;defaultTemplate1



This doesn't seem to be appending the templates properly what is wrong?

Thanks.
kazanka101
New
 
Posts: 3
Joined: Wed Jan 03, 2018 2:24 pm

Urgent Question?

  • Pulling out your Hair?
  • Wasting Time and Money?
  • Deadline Approaching?

Re: RSYSLOG v5 CONF not sending logs with applied template

Postby rgerhards » Wed Jan 03, 2018 3:24 pm

well... that's hard to say ;-) What happens and why do you think it does not work?
rgerhards
Site Admin
 
Posts: 3806
Joined: Thu Feb 13, 2003 11:57 am

Re: RSYSLOG v5 CONF not sending logs with applied template

Postby kazanka101 » Wed Jan 03, 2018 7:00 pm

Its logging but it doesn't seem to be using the correct template. It seems to be still using the regular default one and not the ones I created. The static hostname isn't filters or anything.
kazanka101
New
 
Posts: 3
Joined: Wed Jan 03, 2018 2:24 pm

Re: RSYSLOG v5 CONF not sending logs with applied template

Postby rgerhards » Wed Jan 03, 2018 7:09 pm

mmmmhhhh... I don't see anything obviously wrong. Does it spit out an error message?

Note that this is veeeeeery old, obsolete and unsupported version. But I still think the config should work as we can see.

Does it support config checking via

$ rsyslogd -N1

If so, maybe this brings something up.

HTH
Rainer
rgerhards
Site Admin
 
Posts: 3806
Joined: Thu Feb 13, 2003 11:57 am

Re: RSYSLOG v5 CONF not sending logs with applied template

Postby kazanka101 » Fri Jan 05, 2018 1:41 pm

It looks like it does. I ran the command and it output rsyslogd version 5.8.10.

There is a warning about the config saying...

rsyslogd is running in compatibility mode. Automatically generated config directives may interfere with your rsyslog.conf settings. We suggest upgrading your config and adding -c5 as the first rsyslogd option.
kazanka101
New
 
Posts: 3
Joined: Wed Jan 03, 2018 2:24 pm

Google Ads



Return to Configuration

Who is online

Users browsing this forum: No registered users and 0 guests

cron