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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...