code: public EventRecord parseLine(String line) throws IOException {
      EventRecord retval = null;
  
      if (line != null) {
        // process line
        String patternStr = "(" + dateformat + ")";
        patternStr += "\\s+";
        patternStr += "(" + timeformat + ")";
        patternStr += ".{4}\\s(\\w*)\\s"; // for logLevel
        patternStr += "\\s*([\\w+\\.?]+)"; // for source
        patternStr += ":\\s+(.+)"; // for the message
        Pattern pattern = Pattern.compile(patternStr);
        Matcher matcher = pattern.matcher(line);
  
        if (matcher.find(0) && matcher.groupCount() >= 5) {
          retval = new EventRecord(hostname, ips, parseDate(matcher.group(1),
              matcher.group(2)),
  	    "HadoopLog",
  	    matcher.group(3), // loglevel
              matcher.group(4), // source
              matcher.group(5)); // message
        } else {
          retval = new EventRecord();
        }
      }
  
      return retval;
    }
docs: Parses one line of the log. If the line contains a valid
  log entry, then an appropriate EventRecord is returned, after all
  relevant fields have been parsed.
  
  @param line the log line to be parsed
  
  @return the EventRecord representing the log entry of the line. If
  the line does not contain a valid log entry, then the EventRecord
  returned has isValid() = false. When the end-of-file has been reached,
  null is returned to the caller.