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

ASF subversion and git services commented on NIFI-3949:
-------------------------------------------------------

Commit a1b07b1e9c388d8642699b1d8b101a606dc5bd6a in nifi's branch 
refs/heads/master from [~markap14]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=a1b07b1 ]

NIFI-3949: Updated Grok Reader to allow for sub-patterns to be used when 
determining the schema

This closes #1839.

Signed-off-by: Bryan Bende <[email protected]>


> NullPointerException from GrokReader
> ------------------------------------
>
>                 Key: NIFI-3949
>                 URL: https://issues.apache.org/jira/browse/NIFI-3949
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 1.2.0
>            Reporter: Bryan Bende
>            Priority: Minor
>             Fix For: 1.3.0
>
>
> When creating a GrokReader, I specified an expression of:
> %\{SYSLOGBASE\}%\{GREEDYDATA:message\}
> And I left the default schema strategy of "use fields from grok expression".
> This resulted in an NPE:
> {code}
> java.lang.NullPointerException: null
>       at java.util.Objects.requireNonNull(Objects.java:203)
>       at 
> org.apache.nifi.serialization.record.RecordField.<init>(RecordField.java:50)
>       at 
> org.apache.nifi.serialization.record.RecordField.<init>(RecordField.java:33)
>       at 
> org.apache.nifi.grok.GrokReader.createRecordSchema(GrokReader.java:150)
>       at org.apache.nifi.grok.GrokReader.preCompile(GrokReader.java:136)
> {code}
> This appears to be because I didn't specify a name for SYSLOGBASE, since I 
> was expecting it to see what SYSLOGBASE expands to and then use and named 
> fields under that. If we don't want to support that expansion, then we should 
> at least validate that all parts of the Grok expression have a name.
> Next I changed to using a schema defined in an AvroSchemaRegistry and 
> referencing it by name, but I still got the above exception because the 
> preCompile method always attempts to create a RecordSchema from the 
> GrokExpression, even if you selected a different strategy.



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

Reply via email to