public static Rule getRule(final String p1, final String p2) {
    if (p1.equalsIgnoreCase(LoggingEventFieldResolver.LEVEL_FIELD)) {
      return LevelEqualsRule.getRule(p2);
    } else if (p1.equalsIgnoreCase(LoggingEventFieldResolver.TIMESTAMP_FIELD) || p1.equalsIgnoreCase(LoggingEventFieldResolver.DATE_FIELD)) {
      return TimestampEqualsRule.getRule(p2);
    } else if (p1.equalsIgnoreCase(LoggingEventFieldResolver.MARK_FIELD)) {
      return MarkEqualsRule.getRule(p2);
    } else {
      return new EqualsRule(p1, p2);
    }
  }
Create new instance.

@param p1 field, special treatment for level and timestamp.
@param p2 value
@return new instance
olv-core/src/main/java/pl/otros/logview/accept/query/org/apache/log4j/rule/EqualsRule.java