<?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 How can i dynamically pass the url from file to invoke HTTP? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-dynamically-pass-the-url-from-file-to-invoke-HTTP/m-p/225982#M72715</link>
    <description>&lt;P&gt;I have an set of urls in a file.&lt;/P&gt;&lt;P&gt;sample file:&lt;/P&gt;&lt;P&gt;localhost:1234/aaaa/uyt&lt;/P&gt;&lt;P&gt;localhost:1234/bbbb/grt&lt;/P&gt;&lt;P&gt;localhost:1234/cccc/hgd&lt;/P&gt;&lt;P&gt;etc..&lt;/P&gt;&lt;P&gt;how can I pass this URL dynamically from that file to invoke HTTP processor.&lt;/P&gt;</description>
    <pubDate>Mon, 18 Dec 2017 20:09:43 GMT</pubDate>
    <dc:creator>a_rajeshinfotec</dc:creator>
    <dc:date>2017-12-18T20:09:43Z</dc:date>
    <item>
      <title>How can i dynamically pass the url from file to invoke HTTP?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-dynamically-pass-the-url-from-file-to-invoke-HTTP/m-p/225982#M72715</link>
      <description>&lt;P&gt;I have an set of urls in a file.&lt;/P&gt;&lt;P&gt;sample file:&lt;/P&gt;&lt;P&gt;localhost:1234/aaaa/uyt&lt;/P&gt;&lt;P&gt;localhost:1234/bbbb/grt&lt;/P&gt;&lt;P&gt;localhost:1234/cccc/hgd&lt;/P&gt;&lt;P&gt;etc..&lt;/P&gt;&lt;P&gt;how can I pass this URL dynamically from that file to invoke HTTP processor.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 20:09:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-dynamically-pass-the-url-from-file-to-invoke-HTTP/m-p/225982#M72715</guid>
      <dc:creator>a_rajeshinfotec</dc:creator>
      <dc:date>2017-12-18T20:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: How can i dynamically pass the url from file to invoke HTTP?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-dynamically-pass-the-url-from-file-to-invoke-HTTP/m-p/225983#M72716</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14876/arajeshinfotech.html" nodeid="14876" target="_blank"&gt;@Rajesh AJ&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Use &lt;STRONG&gt;Get File (or) List/FetchFile&lt;/STRONG&gt; processors to &lt;STRONG&gt;fetch the file.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;then use &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1.Split Text Processor&lt;/STRONG&gt;(if you are having each url for a line) with line split count as 1&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="45464-splittext.png" style="width: 1694px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15385i5912BEB975781231/image-size/medium?v=v2&amp;amp;px=400" role="button" title="45464-splittext.png" alt="45464-splittext.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If your file having 4 lines then after split text processor will give seperate flowfiles for each line.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Example:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Input 1 file(having 4 lines)&lt;/STRONG&gt; and &lt;STRONG&gt;output will be 4 flow files&lt;/STRONG&gt;(each line as seperate flowfile)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2.Extract Text processor&lt;/STRONG&gt; to extract the url's to attributes for the flowfile. According to your file content size you need to change the Maximum Buffer size property and i'm extracting all the contents of the flowfile to url attribute by using &lt;STRONG&gt;regex .*&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;url
&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;(.*) //extract the whole content of the flowfile add the content to the flow file url attribute&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="45465-extracttext.png" style="width: 697px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15386i5E523D1D52369B86/image-size/medium?v=v2&amp;amp;px=400" role="button" title="45465-extracttext.png" alt="45465-extracttext.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;then use&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3.invoke http processor&lt;/STRONG&gt; with ${url}&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="45466-invokehttp.png" style="width: 784px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15387i484DCC61553DCD21/image-size/medium?v=v2&amp;amp;px=400" role="button" title="45466-invokehttp.png" alt="45466-invokehttp.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;We are going to use the extracted &lt;STRONG&gt;url attribute from extract text processor&lt;/STRONG&gt; in &lt;STRONG&gt;invoke http processor&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;The extracted &lt;STRONG&gt;url attribute&lt;/STRONG&gt; will be changed &lt;STRONG&gt;dynamically according to the flowfile content&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Flow:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;1.Get File
2.Split Text
3.Extract Text
4.Invoke HTTP&lt;/PRE&gt;&lt;P&gt;If the Answer helped to resolve your issue, &lt;STRONG&gt;Click on Accept button below to accept the answer&lt;/STRONG&gt;, That would be great help to Community users to find solution quickly for these kind of errors.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 01:30:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-dynamically-pass-the-url-from-file-to-invoke-HTTP/m-p/225983#M72716</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T01:30:43Z</dc:date>
    </item>
  </channel>
</rss>

