de.hawlitzek.logparser
Class FHDetailHttpLogParser

java.lang.Object
  |
  +--de.hawlitzek.logparser.FHDetailHttpLogParser

public class FHDetailHttpLogParser
extends java.lang.Object

This log analyzer reads a given http log and counts how many requests come from a browser or search robot. It also allows to set filter (e.g. for counting only html page requests or images) or to count search requests from search engines. It also display which query items are used to find your pages. At last it prints a little statistic.

Author:
Florian Hawlitzek, Hawlitzek IT-Consulting GmbH
Thanks to all contributors, especially to Aaron Holley!

Field Summary
static java.lang.String VERSION
           
 
Constructor Summary
FHDetailHttpLogParser()
          constructor
 
Method Summary
protected  void adjustBrowserStats(java.lang.String browser)
          abjust the statistic of browser occurences for a log entry
protected  void adjustDate(LogEntry logEntry)
          abjust the statistic for a specific date
protected  void adjustForSingleIP(LogEntry logEntry)
          abjust the statistic for a specific IP address
protected  void adjustPageStats(LogEntry logEntry)
          abjust the statistic of a referenced page or ressource
protected  void adjustSearchEngineStats(LogEntry logEntry)
          abjust the statistic of a referenced page or ressource
 void displayStats(java.lang.String filterType)
          display statistics
 java.lang.String getBrowserStats(boolean alphabetic)
          display browser statistics
 java.lang.String getDateStats()
          display Date statistics
 java.lang.String getFilteredOccurences()
          retrun the number of log entries which match to the filter
 java.lang.String getIPStats()
          display IP statistics
 java.lang.String getPageStats()
          display page statistics
 java.lang.String getSearchEngineStats()
          displays the search engine/google statistics
 java.lang.String getTotalOccurences()
          retrun the total number of log entries
static boolean isSearchEngineStats(java.lang.String filterType)
          is this search using referrer or ressource for filtering?
static void main(java.lang.String[] args)
          main method
 void readFile(java.io.File file, java.lang.String filterType, java.lang.String[] filter)
          read and parse a log file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
See Also:
Constant Field Values
Constructor Detail

FHDetailHttpLogParser

public FHDetailHttpLogParser()
constructor

Method Detail

adjustBrowserStats

protected void adjustBrowserStats(java.lang.String browser)
abjust the statistic of browser occurences for a log entry


adjustPageStats

protected void adjustPageStats(LogEntry logEntry)
abjust the statistic of a referenced page or ressource


adjustForSingleIP

protected void adjustForSingleIP(LogEntry logEntry)
abjust the statistic for a specific IP address


adjustDate

protected void adjustDate(LogEntry logEntry)
abjust the statistic for a specific date


adjustSearchEngineStats

protected void adjustSearchEngineStats(LogEntry logEntry)
abjust the statistic of a referenced page or ressource


displayStats

public void displayStats(java.lang.String filterType)
display statistics


getBrowserStats

public java.lang.String getBrowserStats(boolean alphabetic)
display browser statistics


getFilteredOccurences

public java.lang.String getFilteredOccurences()
retrun the number of log entries which match to the filter


getPageStats

public java.lang.String getPageStats()
display page statistics


getIPStats

public java.lang.String getIPStats()
display IP statistics


getDateStats

public java.lang.String getDateStats()
display Date statistics


getSearchEngineStats

public java.lang.String getSearchEngineStats()
displays the search engine/google statistics


getTotalOccurences

public java.lang.String getTotalOccurences()
retrun the total number of log entries


isSearchEngineStats

public static boolean isSearchEngineStats(java.lang.String filterType)
is this search using referrer or ressource for filtering?

Parameters:
filterType - java.lang.String
Returns:
boolean

main

public static void main(java.lang.String[] args)
main method


readFile

public void readFile(java.io.File file,
                     java.lang.String filterType,
                     java.lang.String[] filter)
              throws InvalidLogEntryException
read and parse a log file

Parameters:
file - http log file
filterType - type of the search: HTML: only html pages, MAIN: only main html pages IMG: only images REF: look in referrer, not in requested ressource : in all ressource
filter - set of AND combined search items
InvalidLogEntryException