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

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

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

    https://github.com/apache/nifi/pull/2099#discussion_r134597430
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AttributesToJSON.java
 ---
    @@ -79,6 +80,17 @@
                 .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
                 .build();
     
    +
    +    public static final PropertyDescriptor ATTRIBUTES_REGEX = new 
PropertyDescriptor.Builder()
    +            .name("attributes-to-json-regex")
    +            .displayName("Attributes Regular Expression")
    +            .description("Regular expression that will be evaluated 
against the flow file attributes to select "
    +                    + "the matching attributes. This property can be used 
in combination with the attributes "
    +                    + "list property.")
    +            .required(false)
    +            .addValidator(StandardValidators.REGULAR_EXPRESSION_VALIDATOR)
    --- End diff --
    
    Agree to add EL evaluation against variable registry, system properties, 
etc. But won't add the evaluation against the flow file as it will impact the 
performances as you said.


> AttributesToJson should support regex of Attributes List
> --------------------------------------------------------
>
>                 Key: NIFI-1923
>                 URL: https://issues.apache.org/jira/browse/NIFI-1923
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Extensions
>    Affects Versions: 0.6.1
>            Reporter: Andrew Grande
>            Assignee: Pierre Villard
>
> Today, the Attributes List supports _only_ a comma-separated list of 
> attributes to include in the output JSON. This is not flexible enough, the 
> alternative is to strip every other attribute and 'convert all', which 
> requires more work and may not be possible if some need to be preserved.
> *Proposal:* Attributes List must be a regex which matches the attributes to 
> be included in the resulting JSON. E.g. I have lined up my data to include 
> attributes like below:
> {code}
> {
>   "delimited.header.column.2" : "Assignment",
>   "delimited.header.column.3" : "Organization Name",
>   "delimited.header.column.1" : "Registry",
>   "delimited.header.column.4" : "Organization Address"
> }
> {code}
> The challenge is I have to list *delimited.header.column.1*..N explicitly, 
> every property name. I may not even know how many there will be for a more 
> dynamic flow.
> As a user I should be able to say *delimited.header.column\.** or any 
> arbitrarily complex regex for a more dynamic conversion.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to