}
}
} else if (cl.hasOption("search")) {
String regex = cl.getOptionValue("search");
Pattern regexPatt = Pattern.compile(regex);
while (ex.nextIndex()) {
LoggingEvent evt = readLoggingEvent(ex, loggerContext);
if (null != evt && evt.getLevel().isGreaterOrEqual(level)) {
if (regexPatt.matcher(evt.getFormattedMessage()).matches()) {
writeEvent(evt, appender);
}