Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Nifi Substring : index out of bounds error

avatar

Hi There,

I was looking into nifi examples and I am getting the below error.

I am trying to split this date

20181119112100

I am getting my expected results. Not sure why I am getting the error and warning.

93312-2018-11-20-08-04-13-nif1i.png

93313-2018-11-20-08-30-08-nif2i.png

1 REPLY 1

avatar
Master Guru
@Jacob Paul

I believe your flowfiles having source-date1 attribute with value 20181119112100.

Then change your update attribute property values as

source-date as

${source-date1:substring(0,8)}

source-time as

${source-date1:substring(8,13)}

Then update attribute adds these flowfile attributes for all outgoing flowfiles from UpdateAttribute processor.

In addition you can also perform same kind of operation without extracting as attributes using QueryRecord processor.

Configure/Enable Record Reader/Writer controller services and use apache-calcite's Substring function to create source-date,source-time columns in the flowfile.