<?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 is my url of http-source of flume agent correct? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/is-my-url-of-http-source-of-flume-agent-correct/m-p/112121#M50788</link>
    <description>&lt;P&gt;After setting the flume agent with http-source type and sink as hdfs. I am doing some get and post requests using the url of my flume source ( http-source).&lt;/P&gt;&lt;PRE&gt;&amp;gt;&amp;gt;&amp;gt; import json
&amp;gt;&amp;gt;&amp;gt; b={'a':'b'}
&amp;gt;&amp;gt;&amp;gt; a=json.dumps(b)
&amp;gt;&amp;gt;&amp;gt; a
'{"a": "b"}'
&amp;gt;&amp;gt;&amp;gt; res=requests.post('http://hdp.localdomain:41414',data=a)
&amp;gt;&amp;gt;&amp;gt; res.status_code
400
&amp;gt;&amp;gt;&amp;gt; res=requests.get('http://hdp.localdomain:41414')
&amp;gt;&amp;gt;&amp;gt; res.status_code
500
&lt;/PRE&gt;&lt;P&gt; But i am not getting ok status_code for my requests. I have  two question. One is the url of the flume source correct(). &lt;/P&gt;&lt;PRE&gt;&lt;A href="http://hdp.localdomain:41414" target="_blank"&gt;http://hdp.localdomain:41414&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt; hostname:portnumber. The port is defined in the agent configuration. The agent log shows its running oki.&lt;/P&gt;&lt;P&gt;2nd question is how should i know what type of data i can pass. In the above i passed a as a json. Due to these issue i cannot see anything on the sink.&lt;/P&gt;&lt;P&gt;I am really stuck here. I dont know where is the deadlock&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jan 2017 20:21:31 GMT</pubDate>
    <dc:creator>iraz098</dc:creator>
    <dc:date>2017-01-04T20:21:31Z</dc:date>
    <item>
      <title>is my url of http-source of flume agent correct?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/is-my-url-of-http-source-of-flume-agent-correct/m-p/112121#M50788</link>
      <description>&lt;P&gt;After setting the flume agent with http-source type and sink as hdfs. I am doing some get and post requests using the url of my flume source ( http-source).&lt;/P&gt;&lt;PRE&gt;&amp;gt;&amp;gt;&amp;gt; import json
&amp;gt;&amp;gt;&amp;gt; b={'a':'b'}
&amp;gt;&amp;gt;&amp;gt; a=json.dumps(b)
&amp;gt;&amp;gt;&amp;gt; a
'{"a": "b"}'
&amp;gt;&amp;gt;&amp;gt; res=requests.post('http://hdp.localdomain:41414',data=a)
&amp;gt;&amp;gt;&amp;gt; res.status_code
400
&amp;gt;&amp;gt;&amp;gt; res=requests.get('http://hdp.localdomain:41414')
&amp;gt;&amp;gt;&amp;gt; res.status_code
500
&lt;/PRE&gt;&lt;P&gt; But i am not getting ok status_code for my requests. I have  two question. One is the url of the flume source correct(). &lt;/P&gt;&lt;PRE&gt;&lt;A href="http://hdp.localdomain:41414" target="_blank"&gt;http://hdp.localdomain:41414&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt; hostname:portnumber. The port is defined in the agent configuration. The agent log shows its running oki.&lt;/P&gt;&lt;P&gt;2nd question is how should i know what type of data i can pass. In the above i passed a as a json. Due to these issue i cannot see anything on the sink.&lt;/P&gt;&lt;P&gt;I am really stuck here. I dont know where is the deadlock&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2017 20:21:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/is-my-url-of-http-source-of-flume-agent-correct/m-p/112121#M50788</guid>
      <dc:creator>iraz098</dc:creator>
      <dc:date>2017-01-04T20:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: is my url of http-source of flume agent correct?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/is-my-url-of-http-source-of-flume-agent-correct/m-p/112122#M50789</link>
      <description>&lt;P&gt;You have to send an array of JSONEvents otherwise the handler will fail to deserialize the events. An event must have at least a body and the body must be a string. You can also add optional headers. See the &lt;A href="https://flume.apache.org/FlumeUserGuide.html#jsonhandler"&gt;event specification&lt;/A&gt; in the user guide.&lt;/P&gt;&lt;PRE&gt;import requests
import json

a = [{'body': 'my 1st event data'}, {'body': 'my 2nd event data'}]
requests.post('http://localhost:44444', data=json.dumps(a))
&lt;/PRE&gt;&lt;P&gt;You can also use GET method but still have to specify data to send.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 00:05:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/is-my-url-of-http-source-of-flume-agent-correct/m-p/112122#M50789</guid>
      <dc:creator>mhegedus</dc:creator>
      <dc:date>2017-01-05T00:05:16Z</dc:date>
    </item>
  </channel>
</rss>

