[ 
https://issues.apache.org/jira/browse/NIFI-4789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16343723#comment-16343723
 ] 

ASF GitHub Bot commented on NIFI-4789:
--------------------------------------

Github user markap14 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2411#discussion_r164503950
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExtractGrok.java
 ---
    @@ -142,10 +194,11 @@
                 .description("FlowFiles are routed to this relationship when 
no provided Grok Expression matches the content of the FlowFile")
                 .build();
     
    +
         private final static List<PropertyDescriptor> descriptors;
         private final static Set<Relationship> relationships;
     
    -    private volatile Grok grok = new Grok();
    +    private volatile List<Grok> grokList = new ArrayList<>();
    --- End diff --
    
    This ArrayList is modified once created, so marking it as volatile is not 
sufficient from a thread-safety point of view. We would need to either create a 
new list each time instead of calling `clear()` in the @OnScheduled method or 
make it a synchronized list.


> Enhance ExtractGrok processor to handle multiple grok expressions
> -----------------------------------------------------------------
>
>                 Key: NIFI-4789
>                 URL: https://issues.apache.org/jira/browse/NIFI-4789
>             Project: Apache NiFi
>          Issue Type: New Feature
>          Components: Core Framework
>    Affects Versions: 1.2.0, 1.5.0
>         Environment: all
>            Reporter: Charles Porter
>            Priority: Minor
>              Labels: features
>
> Many flows require running several grok expressions against an input to 
> correctly tag and extract data. using many separate grok processors to 
> accomplish this is unwieldy and hard to maintain.  Supporting multiple grok 
> expressions delimited by comma or user selected delimiter greatly simplifies 
> this.  
> Feature is coded and tested, ready for pull request, if feature is approved



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to