<?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: KeyError Urlencode('indexone') when trying to upload to splunk from python in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/KeyError-Urlencode-indexone-when-trying-to-upload-to-splunk-from/m-p/421134#M7384</link>
    <description>&lt;P&gt;Could you please add the complete error message?&lt;/P&gt;</description>
    <pubDate>Mon, 28 May 2018 08:05:26 GMT</pubDate>
    <dc:creator>xpac</dc:creator>
    <dc:date>2018-05-28T08:05:26Z</dc:date>
    <item>
      <title>KeyError Urlencode('indexone') when trying to upload to splunk from python</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/KeyError-Urlencode-indexone-when-trying-to-upload-to-splunk-from/m-p/421133#M7383</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I have a python UI  using tkinter which is getting the credentials of splunk and the index in textboxes and &lt;BR /&gt;
Then in backend executes code and collects some json data from switches.The trying to upload to splunk using the code below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;spindex = user_args["splunk_index"] 
myindex = service.indexes[spindex ]
myindex.upload(uploadfile) #this uploadfile is a json file which is being uploaded
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;from UI i passed to textbox as 'indexone'&lt;BR /&gt;
I am getting &lt;CODE&gt;keyError: UrlEncoded('indexone')&lt;/CODE&gt; while above lines are executed&lt;/P&gt;

&lt;P&gt;But if I directly write &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;myindex = service.indexes['indexone']
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This works. &lt;BR /&gt;
But i need to pass the index provided on the UI.&lt;BR /&gt;
How to get rid of this KeyError?&lt;/P&gt;</description>
      <pubDate>Mon, 28 May 2018 07:23:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/KeyError-Urlencode-indexone-when-trying-to-upload-to-splunk-from/m-p/421133#M7383</guid>
      <dc:creator>sawgata12345</dc:creator>
      <dc:date>2018-05-28T07:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: KeyError Urlencode('indexone') when trying to upload to splunk from python</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/KeyError-Urlencode-indexone-when-trying-to-upload-to-splunk-from/m-p/421134#M7384</link>
      <description>&lt;P&gt;Could you please add the complete error message?&lt;/P&gt;</description>
      <pubDate>Mon, 28 May 2018 08:05:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/KeyError-Urlencode-indexone-when-trying-to-upload-to-splunk-from/m-p/421134#M7384</guid>
      <dc:creator>xpac</dc:creator>
      <dc:date>2018-05-28T08:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: KeyError Urlencode('indexone') when trying to upload to splunk from python</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/KeyError-Urlencode-indexone-when-trying-to-upload-to-splunk-from/m-p/421135#M7385</link>
      <description>&lt;P&gt;This is error msg&lt;BR /&gt;
&lt;A href="https://ibb.co/c8NOyJ"&gt;https://ibb.co/c8NOyJ&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I have already created the index on splunk as mentioned in this error.&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 02:26:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/KeyError-Urlencode-indexone-when-trying-to-upload-to-splunk-from/m-p/421135#M7385</guid>
      <dc:creator>sawgata12345</dc:creator>
      <dc:date>2018-05-29T02:26:44Z</dc:date>
    </item>
  </channel>
</rss>

