You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Bryan Bende (JIRA)" <ji...@apache.org> on 2017/05/22 20:32:04 UTC

[jira] [Resolved] (NIFI-3949) NullPointerException from GrokReader

     [ https://issues.apache.org/jira/browse/NIFI-3949?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Bende resolved NIFI-3949.
-------------------------------
    Resolution: Fixed
      Assignee: Mark Payne

> 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
>            Assignee: Mark Payne
>            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)