Parsing Windows 7/2008 logs with preg_match

You need additional help with phplogcon, then write into this forum.

Google Ads


Parsing Windows 7/2008 logs with preg_match

Postby JeanBombeur » Thu Jun 28, 2012 2:41 pm

Hi,

I'm trying to parse some Windows 7/2008 logs with a custom preg_match function in logstreamlineparsersyslog.class.php . I can't parse some messages containing the "’" (’ char).

Here's a sample (french system) :
Code: Select all
2012-06-21T15:36:25+02:00 Machine.my-domain.fr MSWinEventLog#0114#011N/A#011N/A#011Thu Jun 21 15:36:25 2012#0111000#011Application Error#011N/A#011N/A#011ERROR#011Machine.my-domain.fr#011Événements d'arrêts inattendus d'applications#011#011Nom de l’application défaillante SecureDownloadManager.exe


Here's my regex :
Code: Select all
/([0-9]{4,4}-[0-9]{1,2}-[0-9]{1,2}T[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}.[0-9]{1,2}:[0-9]{1,2})\s+([0-9A-Za-z-]+.my-domain.fr)\s+(\w+)(#\d{3})(\d)(#\d{3})(N\/A)(#\d{3})(N\/A)(#\d{3})(\w{3}\s+\w{3}\s+\d{1,2}\s+\d{2}:\d{2}:\d{2}\s+\d{4})(#\d{3})(\d{3,6})(#\d{3})([A-Za-z0-9- ]+)(#\d{3})(N\/A)(#\d{3})(N\/A)(#\d{3})(\w+)(#\d{3})([A-Za-z0-9-\. ]+)(#\d{3})([0-9A-Za-zÉéêà'\.- ]+)(#\d{3}#\d{3})(.*)/


Does someone know how to parse the "right single quote" char using preg_match ?
JeanBombeur
New
 
Posts: 5
Joined: Thu Jun 28, 2012 2:30 pm

Urgent Question?

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

Re: Parsing Windows 7/2008 logs with preg_match

Postby JeanBombeur » Thu Jun 28, 2012 3:23 pm

Allright I found a way to avoid it, I added this line to the function ParseLine() :

Code: Select all
$szLine = str_replace("’", "'", $szLine);


This way, LogAnalyzer reads "'" instead of "’".
JeanBombeur
New
 
Posts: 5
Joined: Thu Jun 28, 2012 2:30 pm

Re: Parsing Windows 7/2008 logs with preg_match

Postby chrisreb » Mon Oct 01, 2012 11:54 am

I have the same problems : i can t see messages with french characters
Could you tell me where you put this line ?
Please
chrisreb
New
 
Posts: 2
Joined: Mon Oct 01, 2012 11:48 am

Google Ads



Return to Help

Who is online

Users browsing this forum: No registered users and 0 guests

cron