This open source project aim to filter the log files according to certain criteria and produce small piece of log file according to the given criteria , this is very useful in case of huge log files.
The output is another log file according to your needs (time range + search /exclude keywords).
Here is some of the supported features:
* Parse and filter huge log files using time range.
* Configurable log file date/time format.
* Filter by keywords or exclude lines with certain keywords.
* Can filter errors only in this time range if needed.
* Optionally zip the output file.
* The only mandatory parameter is the log file name, if date is missing today date will be used, start time default to 00:00:00 , end time default to 23:59:59 (both are configurable)
-Ffilenanme : specify the log file name, the only mandatory parameter
-Ddate : specify the date in the log file
-Ttime : specify the start time and end time in the log file (1st T for start time and 2nd for end time)
-Ooutput file : specify the output log file name
-Skey : to search for this key in the log and construct the output file
-Xkey : to exclude the lines contain this key word from the log and construct the output file
-E : if you want the Errors only, this will have no effect if search/exclude parameter is used.
-Z : if you want to zip the output file
You can use either -E or -S or -X and -S or -X has the superiority over -E
The default log file date/time-stamp is "yyyy-MM-dd HH:mm:ss" , you can configure it according to the log file used format.
java -jar LogFilterUtility.jar -Z -E -Sstuck -D2011-08-10 -T04:00:00 -T06:00:00 -Flogfile.log
- Split log file according to specified max size of each split part.
- Export HTML file to color the log file according to the log level.