diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExtractGrok.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExtractGrok.java index 2790dc93d4..6b566380be 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExtractGrok.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExtractGrok.java @@ -255,19 +255,12 @@ public class ExtractGrok extends AbstractProcessor { Grok grok = new Grok(); try { grok.compile(input); - } catch (GrokException e) { + } catch (GrokException | java.util.regex.PatternSyntaxException e) { return new ValidationResult.Builder() .subject(subject) .input(input) .valid(false) - .explanation("Not a valid Grok Expression") - .build(); - } catch (java.util.regex.PatternSyntaxException e) { - return new ValidationResult.Builder() - .subject(subject) - .input(input) - .valid(false) - .explanation("Not a valid Grok Expression") + .explanation("Not a valid Grok Expression - " + e.getMessage()) .build(); }