I have a regular expression that works on part of my data.
Given the log entry:
pam_vas: Authentication <succeeded> for <active directory> user: <bobtheperson> account: <
[email protected]> reason: <N/A> Access cont(upn): <bob>
i can use the regular expression: [\>\:]*\s+(.*?)\:?\s\<(.+?)\> and get the result I am looking for. (http://regexr.com/3fatg)
Authentication = succeeded
for = active directory
user = bobtheperson
account =
[email protected]
reason = N/A
Access cont(upn) = bob
Unfortunately, when I was building this regular expression, I was ignoring a vital part of the log -- the first part.
The log actually looks like this:
Feb 16 20:04:37 hostname su[1111]: [id 123456 auth.info] pam_vas: Authentication <succeeded> for <active directory> user: <bobtheperson> account: <
[email protected]> reason: <N/A> Access cont(upn): <bob>
My extraction no longer works right -- it is thrown off by the first part. (http://regexr.com/3fbod)
How would I exclude the beginning information from this log file?
**Feb 16 20:04:37 hostname su[1111]: [id 123456 auth.info]** pam_vas: Authentication <succeeded> for <active directory> user: <bobtheperson> account: <
[email protected]> reason: <N/A> Access cont(upn): <bob>
I think I need to start my search after the last occurrence of a ] (right before pam_vas) but I cant figure out how to exclude that.
... View more