Simple MySQL + RegEx

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

Simple MySQL + RegEx

Postby bucz » Tue Jun 23, 2009 9:32 am

Hello,

I have some basic problem with MySQL + RegEx. I wanted to extract some data from Cisco log messages and put them to proper columns in the database.

When I use template
Code: Select all
$template tplCisco,"insert into CiscoSystemEvents (Message) values ('%msg:R:.*--end%')",SQL

I get all the message, obvious. but when I use template:
Code: Select all
$template tplCisco,"insert into CiscoSystemEvents (Message) values ('%msg:R,ERE,1,DFLT:(.*)--end%')",SQL

I get NO input to the database, not even **NO MATCH** . Is it a bug or i am doing something wrong?

i am using version 3.18.6-4 that is standard in debian lenny
bucz
New
 
Posts: 5
Joined: Tue Jun 23, 2009 8:16 am

Professional Services Information

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

Re: Simple MySQL + RegEx

Postby rgerhards » Tue Jun 23, 2009 9:39 am

did you give the regex checker a try?

http://www.rsyslog.com/tool-regex
User avatar
rgerhards
Site Admin
 
Posts: 2647
Joined: Thu Feb 13, 2003 11:57 am

Re: Simple MySQL + RegEx

Postby bucz » Tue Jun 23, 2009 9:45 am

Hi, thanks for a fast answer.

Yes, I have even just did copy-paste of the most simple phrase from there and still nothing
bucz
New
 
Posts: 5
Joined: Tue Jun 23, 2009 8:16 am

Re: Simple MySQL + RegEx

Postby rgerhards » Tue Jun 23, 2009 9:46 am

Probably your version is too old. I guess the submatches are not supported by it. I advise to check the changelog or try the current v3-stable.
User avatar
rgerhards
Site Admin
 
Posts: 2647
Joined: Thu Feb 13, 2003 11:57 am

Re: Simple MySQL + RegEx

Postby bucz » Tue Jun 23, 2009 12:57 pm

You were right, it was too old.

4.2.0 is working perfectly!
bucz
New
 
Posts: 5
Joined: Tue Jun 23, 2009 8:16 am

Re: Simple MySQL + RegEx

Postby rgerhards » Tue Jun 23, 2009 12:58 pm

glad it worked out :)
User avatar
rgerhards
Site Admin
 
Posts: 2647
Joined: Thu Feb 13, 2003 11:57 am

Google Ads



Return to Configuration

Who is online

Users browsing this forum: No registered users and 0 guests

cron