Building for the Splunk Platform

Splunk python SDK to update kvstore error

Path Finder

Getting this error when using batch_save to update kvstore through Splunk python SDK.

This works fine when posting same content through curl, not sure if some limitation through splunk SDK. Anyone have any idea on quick fix?

File "/opt/splunk/etc/apps/adp_cmdb/bin/splunklib/", line 3724, in batch_save
return json.loads(self._post('batch_save', headers=KVStoreCollectionData.JSON_HEADER, body=data)'utf-8'))
File "/opt/splunk/etc/apps/adp_cmdb/bin/splunklib/", line 3615, in _post
return + url, owner=self.owner,, sharing=self.sharing, **kwargs)
File "/opt/splunk/etc/apps/adp_cmdb/bin/splunklib/", line 289, in wrapper
return request_fun(self, *args, **kwargs)
File "/opt/splunk/etc/apps/adp_cmdb/bin/splunklib/", line 71, in new_f
val = f(*args, **kwargs)
File "/opt/splunk/etc/apps/adp_cmdb/bin/splunklib/", line 742, in post
response =, all_headers, **query)
File "/opt/splunk/etc/apps/adp_cmdb/bin/splunklib/", line 1208, in post
return self.request(url, message)
File "/opt/splunk/etc/apps/adp_cmdb/bin/splunklib/", line 1228, in request
raise HTTPError(response)
splunklib.binding.HTTPError: HTTP 400 Bad Request -- The provided query was invalid.

0 Karma

Path Finder

When you call the be sure to put an asterisk in front of your passed parameter.*data)

You can see this in the unit tests:
unit test: def test_insert_find_update_data(self):

Get Updates on the Splunk Community!

Observability Highlights | January 2023 Newsletter

 January 2023New Product Releases Splunk Network Explorer for Infrastructure MonitoringSplunk unveils Network ...

Security Highlights | January 2023 Newsletter

January 2023 Splunk Security Essentials (SSE) 3.7.0 ReleaseThe free Splunk Security Essentials (SSE) 3.7.0 app ...

Platform Highlights | January 2023 Newsletter

 January 2023Peace on Earth and Peace of Mind With Business ResilienceAll organizations can start the new year ...