Unable to split content into multiple flowfiles from ExecuteScript's flowfile











up vote
1
down vote

favorite












I have a test flow to split the dates into multiple flowfile. These dates are generated from ExecuteScript.



But unfortunately while using SplitContent to split into multiple flowfiles, the flowfile attributes remain same and not splitted.



Following is my flow:



enter image description here



The ExecuteScript produces flowfile attribute all_first_dates as follows:
enter image description here



I use this in my UpdateAttribute to assign all_first_dates to dates attribute.
enter image description here



And as my dates values are delimited as newline, I gave configuration for splitcontent as follows:



enter image description here



But on splitting, I find the result remains same as original.



enter image description here










share|improve this question




























    up vote
    1
    down vote

    favorite












    I have a test flow to split the dates into multiple flowfile. These dates are generated from ExecuteScript.



    But unfortunately while using SplitContent to split into multiple flowfiles, the flowfile attributes remain same and not splitted.



    Following is my flow:



    enter image description here



    The ExecuteScript produces flowfile attribute all_first_dates as follows:
    enter image description here



    I use this in my UpdateAttribute to assign all_first_dates to dates attribute.
    enter image description here



    And as my dates values are delimited as newline, I gave configuration for splitcontent as follows:



    enter image description here



    But on splitting, I find the result remains same as original.



    enter image description here










    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I have a test flow to split the dates into multiple flowfile. These dates are generated from ExecuteScript.



      But unfortunately while using SplitContent to split into multiple flowfiles, the flowfile attributes remain same and not splitted.



      Following is my flow:



      enter image description here



      The ExecuteScript produces flowfile attribute all_first_dates as follows:
      enter image description here



      I use this in my UpdateAttribute to assign all_first_dates to dates attribute.
      enter image description here



      And as my dates values are delimited as newline, I gave configuration for splitcontent as follows:



      enter image description here



      But on splitting, I find the result remains same as original.



      enter image description here










      share|improve this question















      I have a test flow to split the dates into multiple flowfile. These dates are generated from ExecuteScript.



      But unfortunately while using SplitContent to split into multiple flowfiles, the flowfile attributes remain same and not splitted.



      Following is my flow:



      enter image description here



      The ExecuteScript produces flowfile attribute all_first_dates as follows:
      enter image description here



      I use this in my UpdateAttribute to assign all_first_dates to dates attribute.
      enter image description here



      And as my dates values are delimited as newline, I gave configuration for splitcontent as follows:



      enter image description here



      But on splitting, I find the result remains same as original.



      enter image description here







      apache-nifi






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 7 at 10:39









      Flimzy

      1




      1










      asked Nov 7 at 10:37









      Jasim Waheed

      128111




      128111
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          SplitContent processor splits flowfile contents based on the byte sequence but not the flowfile attributes.



          In your case flow will be something like below:



          1.GenerateFlowfile
          2.ExecuteScript
          3.ReplaceText //Always replace as Replacement strategy and
          Replacement value as ${all_first_dates}
          4.SplitContent (or) SplitText //to split each line as individual flowfile
          5.ExtractText //add new property dates with value as (.*)
          Now each flowfile will have dates attribute with the value
          6.PutFile.


          In addition if you want to get some specific value from ${all_first_dates} then use getDelimitedField function on the attribute value using UpdateAttribute processor.






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53187761%2funable-to-split-content-into-multiple-flowfiles-from-executescripts-flowfile%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            3
            down vote



            accepted










            SplitContent processor splits flowfile contents based on the byte sequence but not the flowfile attributes.



            In your case flow will be something like below:



            1.GenerateFlowfile
            2.ExecuteScript
            3.ReplaceText //Always replace as Replacement strategy and
            Replacement value as ${all_first_dates}
            4.SplitContent (or) SplitText //to split each line as individual flowfile
            5.ExtractText //add new property dates with value as (.*)
            Now each flowfile will have dates attribute with the value
            6.PutFile.


            In addition if you want to get some specific value from ${all_first_dates} then use getDelimitedField function on the attribute value using UpdateAttribute processor.






            share|improve this answer

























              up vote
              3
              down vote



              accepted










              SplitContent processor splits flowfile contents based on the byte sequence but not the flowfile attributes.



              In your case flow will be something like below:



              1.GenerateFlowfile
              2.ExecuteScript
              3.ReplaceText //Always replace as Replacement strategy and
              Replacement value as ${all_first_dates}
              4.SplitContent (or) SplitText //to split each line as individual flowfile
              5.ExtractText //add new property dates with value as (.*)
              Now each flowfile will have dates attribute with the value
              6.PutFile.


              In addition if you want to get some specific value from ${all_first_dates} then use getDelimitedField function on the attribute value using UpdateAttribute processor.






              share|improve this answer























                up vote
                3
                down vote



                accepted







                up vote
                3
                down vote



                accepted






                SplitContent processor splits flowfile contents based on the byte sequence but not the flowfile attributes.



                In your case flow will be something like below:



                1.GenerateFlowfile
                2.ExecuteScript
                3.ReplaceText //Always replace as Replacement strategy and
                Replacement value as ${all_first_dates}
                4.SplitContent (or) SplitText //to split each line as individual flowfile
                5.ExtractText //add new property dates with value as (.*)
                Now each flowfile will have dates attribute with the value
                6.PutFile.


                In addition if you want to get some specific value from ${all_first_dates} then use getDelimitedField function on the attribute value using UpdateAttribute processor.






                share|improve this answer












                SplitContent processor splits flowfile contents based on the byte sequence but not the flowfile attributes.



                In your case flow will be something like below:



                1.GenerateFlowfile
                2.ExecuteScript
                3.ReplaceText //Always replace as Replacement strategy and
                Replacement value as ${all_first_dates}
                4.SplitContent (or) SplitText //to split each line as individual flowfile
                5.ExtractText //add new property dates with value as (.*)
                Now each flowfile will have dates attribute with the value
                6.PutFile.


                In addition if you want to get some specific value from ${all_first_dates} then use getDelimitedField function on the attribute value using UpdateAttribute processor.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 7 at 12:04









                Shu

                3,8112417




                3,8112417






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53187761%2funable-to-split-content-into-multiple-flowfiles-from-executescripts-flowfile%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    Xamarin.form Move up view when keyboard appear

                    Post-Redirect-Get with Spring WebFlux and Thymeleaf

                    Anylogic : not able to use stopDelay()