views:

29

answers:

1

I have fields like:

"GET /?blahblahblah HTTP/1.1" 200 43 "http://www.thesun.co.uk/sol/homepage/" 1 blahblah - "en-gb" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; GTB0.0; FunWebProducts; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"

i'm looking for a java library or code that can decode this, parse it apart, and provide programatic access to the components, especially the user agent info. googling didnt turn up anything useful, but as this info is used all the time, there must be existing systems for doing what i require.

A: 

What you are looking for is an apache LOG parser. You may find JXLA useful, or google for "Java apache log parser".

Jim Garrison