in reply to Re^2: Extracting useful information from Windows Event Logs
in thread Extracting useful information from Windows Event Logs
my $text="Document Wod.doc owned by DUSASAE was printed on HPLJ5 via p +ort LPT1. Size in bytes: 37836; pages printed: 1"; if ($text =~ /^Document\s+(\S+)\s+owned by\s+(\w+).+pages printed:\s+( +\d+)\z/) { print <<"EOT"; pages printed: $3 filename: '$1' username: $2 EOT }
Appears to work for this simple case. But can the filename and username contain spaces. If so, what happens? Hard to say without a more precise spec. Feel free to adapt to your needs, though.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Extracting useful information from Windows Event Logs
by saadatsaeed (Initiate) on May 24, 2007 at 15:04 UTC | |
by blazar (Canon) on May 24, 2007 at 15:56 UTC |