@Override
  public void processLogLine(String line) {
    if(queryMatches) {
      for(Entry<String, Pattern> e : regexToPattern.entrySet()) {
        String regex = e.getKey();
        Pattern p = e.getValue();
        boolean lineMatches = p.matcher(line).find();
        if(lineMatches) {
          regexToLogLines.get(regex).add(line);
       }
      }
    }
  }
Before init is called, logRegexes and queryRegexes should be populated.
ql/src/java/org/apache/hadoop/hive/ql/exec/errors/RegexErrorHeuristic.java