Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2014-09-21 00:09:22,718 TRACE [user: admin12] common.Log (PerformanceExtractor.Python:9776) - ClientId:895,UserId:258,Ip:111.1.1.1,DurationMls:23,DurationString:0.023 seconds,Url:Calculate.LoanExmple
- $date = 2014-09-21 00:09:22,718 $user = admin12 $ClientId= 895 $UserID=258 $ip = 111.1.1.1 $time=0.023 $url=Calculate.LoanExmple
- {
- print $line;
- --formatting here?
- last if $. == 500;
- }
- while (<$fh>) {
- my @fields = m{^
- (d{4}-d{2}-d{2}sd{2}:d{2}:[d,]+)
- s TRACE s
- [user:s(w+)]
- s common.Log s (PerformanceExtractor.Python:d+) s - s
- ClientId:(d+),
- UserId:(d+),
- Ip:([d.]+),
- DurationMls:d+,
- DurationString:([d.]+) s seconds,
- Url:(S+)
- $}x
- or next; # skip lines which don't match regexp
- printf('$date=%s; $user=%s; $client_id=%s; $user_id=%s; $ip=%s; $time=%s; $url=%s', @fields);
- print "n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement