M
Max Adams
All, I don't get on very well with reg exps at the best of times, and this
is proving to be very taxing to me.
I have a BIG log file which contins thousands of lines similar to this one:
[SERVER05] EnumServerProcesses : (0x31fdb30)
[SERVER06:c:\workgroup\Stages.exe:2588:{56DC057D-2D02-4A2A-A308-B625555C6345
}] CEnumServerProcesses::Execute() : SQL = begin
PA_Stages.PR_GetProcessListTASKID); end; : CursonName = NULL : Options = 6
: SessionID = 12127793 11:59:29 27/08/2003 tid:1076 pid:2304
tick:16640900672768 .\EnumServerProcesses.cpp (55)
This is all one line in the log file. The data I want out from this one
line is:
"Stages.exe"
"begin PA_Stages.PR_GetProcessListTASKID)"
"11:59:29 27/08/2003"
Currently the closest reg exp I have at the moment is
my @extract = $_ =~ /^\[([^:]+).*?([^\\]+\.exe)\:/i;
But this only tries to get the process name and even this does not work with
the line above.
The server names in the example above are not guarenteed to be the same as
we have many machines and the path to the executable is not important to me,
just the process executable name.
Can anyone please help and give me some guide to the reg exp I need to be
using to get these 3 fields out of the file successfully.
PT
is proving to be very taxing to me.
I have a BIG log file which contins thousands of lines similar to this one:
[SERVER05] EnumServerProcesses : (0x31fdb30)
[SERVER06:c:\workgroup\Stages.exe:2588:{56DC057D-2D02-4A2A-A308-B625555C6345
}] CEnumServerProcesses::Execute() : SQL = begin
PA_Stages.PR_GetProcessListTASKID); end; : CursonName = NULL : Options = 6
: SessionID = 12127793 11:59:29 27/08/2003 tid:1076 pid:2304
tick:16640900672768 .\EnumServerProcesses.cpp (55)
This is all one line in the log file. The data I want out from this one
line is:
"Stages.exe"
"begin PA_Stages.PR_GetProcessListTASKID)"
"11:59:29 27/08/2003"
Currently the closest reg exp I have at the moment is
my @extract = $_ =~ /^\[([^:]+).*?([^\\]+\.exe)\:/i;
But this only tries to get the process name and even this does not work with
the line above.
The server names in the example above are not guarenteed to be the same as
we have many machines and the path to the executable is not important to me,
just the process executable name.
Can anyone please help and give me some guide to the reg exp I need to be
using to get these 3 fields out of the file successfully.
PT