<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Nifi Substring : index out of bounds error in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Nifi-Substring-index-out-of-bounds-error/m-p/236282#M198095</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/97732/jacobhansraj.html" nodeid="97732"&gt;@Jacob Paul&lt;/A&gt;&lt;P&gt;I believe your flowfiles having &lt;STRONG&gt;&lt;U&gt;source-date1&lt;/U&gt;&lt;/STRONG&gt; attribute with value &lt;STRONG&gt;20181119112100.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Then change your &lt;A href="https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#substring" target="_blank"&gt;update attribute&lt;/A&gt; property values as&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;source-date&lt;/STRONG&gt; as&lt;/P&gt;&lt;PRE&gt;${source-date1:substring(0,8)}&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;source-time&lt;/STRONG&gt; as&lt;/P&gt;&lt;PRE&gt;${source-date1:substring(8,13)}&lt;/PRE&gt;&lt;P&gt;Then update attribute adds these flowfile attributes for all outgoing flowfiles from UpdateAttribute processor.&lt;/P&gt;&lt;P&gt;In addition you can also perform same kind of operation without extracting as attributes using &lt;A href="https://community.hortonworks.com/articles/121794/running-sql-on-flowfiles-using-queryrecord-process.html" target="_blank"&gt;QueryRecord processo&lt;/A&gt;r.&lt;/P&gt;&lt;P&gt;Configure/Enable Record &lt;STRONG&gt;Reader/Writer controller services&lt;/STRONG&gt; and use &lt;STRONG&gt;apache-calcite's&lt;/STRONG&gt; &lt;STRONG&gt;Substring &lt;/STRONG&gt;function to create source-date,source-time columns in the flowfile.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Nov 2018 05:27:38 GMT</pubDate>
    <dc:creator>Shu_ashu</dc:creator>
    <dc:date>2018-11-20T05:27:38Z</dc:date>
  </channel>
</rss>

