Splunk Dev

KeyError Urlencode('indexone') when trying to upload to splunk from python

sawgata12345
Path Finder

Hi,
I have a python UI using tkinter which is getting the credentials of splunk and the index in textboxes and
Then in backend executes code and collects some json data from switches.The trying to upload to splunk using the code below

spindex = user_args["splunk_index"] 
myindex = service.indexes[spindex ]
myindex.upload(uploadfile) #this uploadfile is a json file which is being uploaded

from UI i passed to textbox as 'indexone'
I am getting keyError: UrlEncoded('indexone') while above lines are executed

But if I directly write

myindex = service.indexes['indexone']

This works.
But i need to pass the index provided on the UI.
How to get rid of this KeyError?

xpac
SplunkTrust
SplunkTrust

Could you please add the complete error message?

0 Karma

sawgata12345
Path Finder

This is error msg
https://ibb.co/c8NOyJ

I have already created the index on splunk as mentioned in this error.

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...