Kettle‎ > ‎

Tomcat Log File Sample


Introduction

This simple sample introduce the use of Kettle's Regex step to process a Tomcat's log file. We will parse the log and separated the row based on a regular expression pattern.

You can download the file samples at the end of the article.

Sample Detail

  1. We get the log file's content through a Text Input Step (Tomcat Logs).
  2. Validate the pattern using Regex Evalution step, only get rows with date information plus message in the same row. Save the boolean result in a field (result).
  3. Filtering the rows from previous step based on result field using Filter Rows step.
  4. You can see the results by previewing Others and Tanggal dummy steps.
  5. Split the matching content into 3 fields (tanggal, jam and pesan) by using Modified Java Script Value step (Hasil Akhir).
  6. Done

Drawback


By using Modified Java Script Value, we have the risk of processing bottleneck in this step as scripting can be slower than if we implemented it in plugin form.

Nevertheless, this sample show the flexibility of Kettle if you know how to manipulate any data type using Java language.

ċ
localhost.2008-06-29.log
(95k)
Feris Thia,
Jul 4, 2008, 8:27 AM
ċ
log_parsing.ktr
(11k)
Feris Thia,
Jul 4, 2008, 8:26 AM
Comments