splunk-sdk-python icon indicating copy to clipboard operation
splunk-sdk-python copied to clipboard

Key Error in Python Splunk SDK while accessing KV store

Open souravsharma6633 opened this issue 4 years ago • 5 comments

Hi, I am facing the same KeyError issue as referenced here https://github.com/splunk/splunk-sdk-python/issues/256 . But, I already have the collection defined in collections.conf file. I am able to CRUD the collection from the rest API but custom command is giving this KeyError. Urgent help is needed.

Thanks, Sourav

souravsharma6633 avatar Nov 18 '22 12:11 souravsharma6633

On my local, when I am the admin it's working fine. But, on company hosted splunk, it is throwing the error. I am even able to access it using SPL command (inputlookup) also. But, the custom command is giving error.

souravsharma6633 avatar Nov 18 '22 12:11 souravsharma6633

Hi @souravsharma6633 , Would you please share the steps to reproduce the issue. Based on our initial analysis it seems like an access issue, so if you share the your use case we may be able to identify the root cause.

akaila-splunk avatar Nov 29 '22 12:11 akaila-splunk

Hi @akaila-splunk, I am having a KVStore and lookup defined in collections.conf/transfomrms.conf. What I debugged till now is when I am trying to access KVStore using client.connect function of splunklib, it is being called once by the stream function. I am using the StreamingCommand to stream, process and yield the data. But, the internal logs show that the storage/collections/config is being called on the search head I am connecting to ..and all the indexers. The search head is giving a 200 response while the indexers are giving 404 error. I am getting KeyError as if my collection in KVStore does not exist. I have tried using local=true in commands.conf also for my custom command. But, still same behavior. FYI, inputlookup/outputlookup commands work fine with all the requests going to SH only. API is also working fine.

Now, I need inputs on what can be the issue? Need some fast response as the issue is being persistent for 2 weeks and I am not able to proceed.

Thanks and Regards, Sourav

souravsharma6633 avatar Dec 01 '22 06:12 souravsharma6633

Hi @souravsharma6633, we have tried to access the kvstore from the CSC app with the code mentioned in issue#256 but unable to reproduce issue on our end, we are getting the data without any errors. so requesting you to share the .py script file code along with .conf files and spl query, and information about the environment along with version details, will help us to reproduce the issue.

akaila-splunk avatar Dec 05 '22 12:12 akaila-splunk

Closing the Issue as we haven't received any response. @souravsharma6633 please reopen the Issue if you still face the issue.

akaila-splunk avatar Jan 11 '23 07:01 akaila-splunk