Caused by: org.apache.flink.streaming.runtime.tasks.ExceptionInChainedOperatorException: Could not forward element to next operator at org.apache.flink.streaming.runtime.tasks.OperatorChain$ChainingOutput.pushToOperator(OperatorChain.java:549) at org.apache.flink.streaming.runtime.tasks.OperatorChain$ChainingOutput.collect(OperatorChain.java:523) at org.apache.flink.streaming.runtime.tasks.OperatorChain$ChainingOutput.collect(OperatorChain.java:483) at org.apache.flink.streaming.api.operators.AbstractStreamOperator$CountingOutput.collect(AbstractStreamOperator.java:727) at org.apache.flink.streaming.api.operators.AbstractStreamOperator$CountingOutput.collect(AbstractStreamOperator.java:705) at org.apache.flink.streaming.api.operators.StreamMap.processElement(StreamMap.java:41) at org.apache.flink.streaming.runtime.tasks.OperatorChain$ChainingOutput.pushToOperator(OperatorChain.java:546) ... 58 more Caused by: java.lang.NullPointerException at java.util.regex.Matcher.getTextLength(Matcher.java:1283) at java.util.regex.Matcher.reset(Matcher.java:309) at java.util.regex.Matcher.<init>(Matcher.java:229) at java.util.regex.Pattern.matcher(Pattern.java:1093) at com.google.code.regexp.Matcher.<init>(Unknown Source) at com.google.code.regexp.Pattern.matcher(Unknown Source) at com.splunk.streaming.functions.streaming.function.AbstractRegexParseWithOptionsFunction$ApplyRegex.map(AbstractRegexParseWithOptionsFunction.java:315) at com.splunk.streaming.functions.streaming.function.AbstractRegexParseWithOptionsFunction$ApplyRegex.map(AbstractRegexParseWithOptionsFunction.java:283) at com.splunk.streaming.functions.streaming.function.RichMapFunctionWithMetrics.map(RichMapFunctionWithMetrics.java:104) at com.splunk.streaming.functions.streaming.function.RichMapFunctionWithMetrics.map(RichMapFunctionWithMetrics.java:24) at org.apache.flink.streaming.api.operators.StreamMap.processElement(StreamMap.java:41) at org.apache.flink.streaming.runtime.tasks.OperatorChain$ChainingOutput.pushToOperator(OperatorChain.java:546) ... 64 more
Caused by: java.lang.NullPointerException at java.util.regex.Matcher.getTextLength(Matcher.java:1283) at java.util.regex.Matcher.reset(Matcher.java:309) at java.util.regex.Matcher.<init>(Matcher.java:229) at java.util.regex.Pattern.matcher(Pattern.java:1093)It's saying that a field with null value was passed to the regex(Parse with regex)
eval body=tostring(body)
| rex field=body "\\\"EventName\\\":\\\"(?<EventName>[^\\\"]+)\\\","
| where EventName IN ("Requestor","Approver","System","Administrators","Assign","Add")
| rex field=body "\\\"Target\\\":\\\"(?<Target>[^\\\"]+)\\\","
| rex field=Target "(Asset|Domain|ManagedSystem)[:=](?:[^ ]+) (M|Managed)?Account[:=](?:[^\\\\]+\\\\\\\\)?(?<userName1>.+)"
| rex field=Target "(?:[^\\/]+)\\/(?<userName2>[^,]+)"
So| rex field=body "\\\"Target\\\":\\\"(?<Target>[^\\\"]+)\\\","It does not find a match. Target will be null
| rex field=Target "(Asset|Domain|ManagedSystem)[:=](?:[^ ]+) (M|Managed)?Account[:=](?:[^\\\\]+\\\\\\\\)?(?<userName1>.+)"
The NPE no longer occurs in the scenario of when a Null is passed to the rex function in DSP 1.3.1 .
To workaround in earlier versions of DSP , can. implement the following workarounds:
Add eval to set the field to a space(' ') before passing to rex
fieldname=if(isnull(fieldname)," ",fieldname)
If the events with null fields are not required to be processed:
where fieldname IS NOT NULL
| Revision | Publish Date | Comments |
|---|---|---|
1.0 |
29-Sep-2026
|
Initial Release |