Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. 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
  2.  
  3. $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
  4.  
  5. {
  6. print $line;
  7.  
  8. --formatting here?
  9.  
  10. last if $. == 500;
  11.  
  12. }
  13.  
  14. while (<$fh>) {
  15. my @fields = m{^
  16. (d{4}-d{2}-d{2}sd{2}:d{2}:[d,]+)
  17. s TRACE s
  18. [user:s(w+)]
  19. s common.Log s (PerformanceExtractor.Python:d+) s - s
  20. ClientId:(d+),
  21. UserId:(d+),
  22. Ip:([d.]+),
  23. DurationMls:d+,
  24. DurationString:([d.]+) s seconds,
  25. Url:(S+)
  26. $}x
  27. or next; # skip lines which don't match regexp
  28.  
  29. printf('$date=%s; $user=%s; $client_id=%s; $user_id=%s; $ip=%s; $time=%s; $url=%s', @fields);
  30. print "n";
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement