• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

parsing logfile

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I am getting a appache logfile so I have to parse the file and and store it in a database table what are the steps involved here...
i mean how to parse the log file.
sample line from my log file.
216.148.244.91 - - [11/Mar/2005:11:05:27 -0500] "GET /tracker.html?retailer=Test+Retailer&order=xyz123&uniqueId=12345&sku=sku-00005&prodName=the%20greatest%20product%20in%20all%20the%20world&qty=1&unitPrice=15.25 HTTP/1.0" 200 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
 
author & internet detective
Posts: 39883
798
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ranga,
Before you go about trying to do this yourself, take a look at log4j's database appender. It looks like this is from a web server access log, rather than log4j, but you can still get some ideas.

Then you can decide on what your schema should be. For example, it looks like it would be useful to store the IP address, date/time, etc.
 
Willie Smits can speak 40 languages. This tiny ad can speak only one:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!