templates and database

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

templates and database

Postby bluto » Fri Feb 05, 2010 4:58 pm

Hi, after some troubles with syslog-ng, I've installed rsyslog+mysql with phplogcon to collect event logs from my windows 2003 server via Snare Agent, and actually phplogcon 2.8.0 is working fine.
My question: if I want to discard the first 10 characters in the column of the messages, I use this template:

$template bluto1, "%timegenerated% %HOSTNAME% %msg:10:$%\n"

this works fine if the logs are stored in a text file, but by using mysql and by appending the template bluto1, the following string doesn't store any log in the database:
:hostname, contains, "windows" :ommysql:127.0.0.1,Syslog,rsyslog,secretpwd;bluto1
Whitout the template bluto1, all is working normal.

Maybe am I doing the wrong thing?
Thanks as always for your support and sorry for my poor english :oops:

bluto
bluto
Avarage
 
Posts: 10
Joined: Wed Feb 03, 2010 3:03 pm

Professional Services Information

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

Re: templates and database

Postby bluto » Mon Feb 08, 2010 10:47 pm

well, I think my previous post was not so clear, anyway I'd like to know how to customize the StdDBFmt template, in order to change the property %msg% to something like: %msg:20:$%

best regards
bluto
bluto
Avarage
 
Posts: 10
Joined: Wed Feb 03, 2010 3:03 pm

Re: templates and database

Postby Burn » Tue Feb 09, 2010 11:28 am

here are the sources http://git.adiscon.com/?p=rsyslog.git;a ... /syslogd.c
Search for template_StdDBFmt
Burn
Frequent Poster
 
Posts: 56
Joined: Wed Jan 20, 2010 7:15 am

Re: templates and database

Postby bluto » Tue Feb 09, 2010 2:48 pm

Burn wrote:here are the sources http://git.adiscon.com/?p=rsyslog.git;a ... /syslogd.c
Search for template_StdDBFmt


wow, thanks a lot, I solved my problem!
bluto
Avarage
 
Posts: 10
Joined: Wed Feb 03, 2010 3:03 pm

Google Ads



Return to Configuration

Who is online

Users browsing this forum: No registered users and 2 guests

cron