<?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>topic Re: how to use splunk appserver receive and save files in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/how-to-use-splunk-appserver-receive-and-save-files/m-p/524907#M9403</link>
    <description>&lt;P&gt;That wiki page is very old (4 major versions!) so I would be very careful about using anything you read there.&amp;nbsp; CherryPy is deprecated in Splunk 8 so that's another reason to try a different approach.&lt;/P&gt;&lt;P&gt;Please describe what you want to accomplish and perhaps someone will have a modern way to do it.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Oct 2020 17:02:35 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-10-15T17:02:35Z</dc:date>
    <item>
      <title>how to use splunk appserver receive and save files</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/how-to-use-splunk-appserver-receive-and-save-files/m-p/524886#M9402</link>
      <description>&lt;P&gt;Hi Splunker,&lt;/P&gt;&lt;DIV class="trans-right"&gt;&lt;DIV class="output-wrap small-font"&gt;&lt;DIV class="output-mod ordinary-wrap"&gt;&lt;DIV class="output-bd"&gt;&lt;P class="ordinary-output target-output clearfix"&gt;&lt;SPAN class=""&gt;Today, I refer to this link&amp;nbsp;&lt;A title="GUIDevelopment" href="https://wiki.splunk.com/Community:40GUIDevelopment" target="_blank" rel="noopener"&gt;https://wiki.splunk.com/Community:40GUIDevelopment&lt;/A&gt;&amp;nbsp; to develop the interface. I use the python library requests to upload the file, and use the CherryPy of Splunk to receive the file. But I can't receive and save the file. I printed the parameter content, but I didn't receive any parameter. Here is my code。&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ordinary-output target-output clearfix"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="ordinary-output target-output clearfix"&gt;&lt;SPAN class=""&gt;I use the python library requests to upload the file&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    def forwardFile(self, filePath, fileName, url):
        files = {'ufile': open(os.path.join(filePath, fileName), 'rb')}
        data = {'xxx':'aaa','xxdd':'bbb'}
        headers = {}
        headers["content-type"] = 'multipart/form-data'
        r = requests.post(url, files=files,data=data ,headers=headers, verify=False)
        logger.info(r)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;use the CherryPy of Splunk to receive the file&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    @route('/:action=receive')
    @expose_page(must_login=False, methods=['GET','POST'])
    @cherrypy.expose
    def receive(self, **kwargs):
        logger.info("111")
        logger.info(kwargs)
        logger.info("222")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then i see the file web_service.log&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;2020-10-15 23:21:07,472 INFO	[5f8868e36d107834250] &amp;lt;string&amp;gt;:68 - hello world:http://127.0.0.1
2020-10-15 23:21:07,501 INFO	[5f8868e37f107d00ad0] &amp;lt;string&amp;gt;:145 - 111
2020-10-15 23:21:07,501 INFO	[5f8868e37f107d00ad0] &amp;lt;string&amp;gt;:146 - {'action': 'receive'}
2020-10-15 23:21:07,501 INFO	[5f8868e37f107d00ad0] &amp;lt;string&amp;gt;:147 - 222
2020-10-15 23:21:07,507 INFO	[5f8868e36d107834250] &amp;lt;string&amp;gt;:79 - &amp;lt;Response [200]&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to get the value of ufile ？&lt;/P&gt;&lt;P&gt;then i can save it.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 15:29:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/how-to-use-splunk-appserver-receive-and-save-files/m-p/524886#M9402</guid>
      <dc:creator>hellosplunkit</dc:creator>
      <dc:date>2020-10-15T15:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to use splunk appserver receive and save files</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/how-to-use-splunk-appserver-receive-and-save-files/m-p/524907#M9403</link>
      <description>&lt;P&gt;That wiki page is very old (4 major versions!) so I would be very careful about using anything you read there.&amp;nbsp; CherryPy is deprecated in Splunk 8 so that's another reason to try a different approach.&lt;/P&gt;&lt;P&gt;Please describe what you want to accomplish and perhaps someone will have a modern way to do it.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 17:02:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/how-to-use-splunk-appserver-receive-and-save-files/m-p/524907#M9403</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-10-15T17:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to use splunk appserver receive and save files</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/how-to-use-splunk-appserver-receive-and-save-files/m-p/583887#M9404</link>
      <description>&lt;P&gt;hello,&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/185234" target="_self"&gt;&lt;SPAN class=""&gt;hellosplunkit&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the same problem. &lt;SPAN&gt;Have you solved the problem yet??&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 03:40:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/how-to-use-splunk-appserver-receive-and-save-files/m-p/583887#M9404</guid>
      <dc:creator>feelcool</dc:creator>
      <dc:date>2022-02-07T03:40:21Z</dc:date>
    </item>
  </channel>
</rss>

