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

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

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

    https://github.com/apache/nifi/pull/1564#discussion_r104315650
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ScanAttribute.java
 ---
    @@ -75,21 +87,24 @@
                 .defaultValue(MATCH_CRITERIA_ANY)
                 .build();
         public static final PropertyDescriptor ATTRIBUTE_PATTERN = new 
PropertyDescriptor.Builder()
    -            .name("Attribute Pattern")
    +            .name("attribute-pattern")
    +            .displayName("Attribute Pattern")
                 .description("Regular Expression that specifies the names of 
attributes whose values will be matched against the terms in the dictionary")
                 .required(true)
                 .addValidator(StandardValidators.REGULAR_EXPRESSION_VALIDATOR)
                 .defaultValue(".*")
                 .build();
         public static final PropertyDescriptor DICTIONARY_FILE = new 
PropertyDescriptor.Builder()
    -            .name("Dictionary File")
    +            .name("dictionary-file")
    +            .displayName("Dictionary File")
                 .description("A new-line-delimited text file that includes the 
terms that should trigger a match. Empty lines are ignored.  The contents of "
                         + "the text file are loaded into memory when the 
processor is scheduled and reloaded when the contents are modified.")
                 .required(true)
                 .addValidator(StandardValidators.FILE_EXISTS_VALIDATOR)
                 .build();
         public static final PropertyDescriptor DICTIONARY_FILTER = new 
PropertyDescriptor.Builder()
    -            .name("Dictionary Filter Pattern")
    --- End diff --
    
    Must retain the previously existing name so as not to disturb existing 
configurations.  Andy's advice for the new property is good to follow going 
forward but it is wise to avoid changing old names.


> ScanAttribute should support tagging a flowfile with metadata value from the 
> supplied dictionary
> ------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-3497
>                 URL: https://issues.apache.org/jira/browse/NIFI-3497
>             Project: Apache NiFi
>          Issue Type: Improvement
>            Reporter: Joseph Witt
>            Assignee: Joseph Witt
>
> Today ScanAttribute just looks through the supplied dictionary and given 
> object for a string matching hit.  If it hits then it is a match otherwise it 
> is a 'not found'.  However, when a hit occurs it can often be quite useful to 
> gather additional metadata about that hit.  This makes cases like 
> enrichment/tagging much easier.
> So, plan is to have ScanAttribute support a dictionary value demarcator which 
> would separate the dictionary term from some string response that will be 
> added to the flowfile.  For instance a dictionary might have
> apples:These are red or green
> bananas:These are yellow unless you should toss them or make bread
> Then if a hit occurs on 'apples' the flowfile that contained such an 
> attribute would have a new attribute such as 'dictionary.hit.term' = 'apple' 
> and 'dictionary.hit.metadata' = 'These are red or green'.
> This means downstream processors could extract that metadata and do 
> interesting things with it.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to