<?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: Splunk python SDK to update kvstore error in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-python-SDK-to-update-kvstore-error/m-p/417817#M7287</link>
    <description>&lt;P&gt;When you call the client.data.batch_save() be sure to put an asterisk in front of your passed parameter.&lt;BR /&gt;
     client.data.batch_save(*data)&lt;/P&gt;

&lt;P&gt;You can see this in the unit tests: &lt;BR /&gt;
&lt;A href="https://github.com/splunk/splunk-sdk-python/blob/master/tests/test_kvstore_batch.py" target="_blank"&gt;https://github.com/splunk/splunk-sdk-python/blob/master/tests/test_kvstore_batch.py&lt;/A&gt;&lt;BR /&gt;
unit test: def test_insert_find_update_data(self):&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 23:55:04 GMT</pubDate>
    <dc:creator>jrouse025</dc:creator>
    <dc:date>2020-09-29T23:55:04Z</dc:date>
    <item>
      <title>Splunk python SDK to update kvstore error</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-python-SDK-to-update-kvstore-error/m-p/417816#M7286</link>
      <description>&lt;P&gt;Getting this error when using batch_save to update kvstore through Splunk python SDK.  &lt;/P&gt;

&lt;P&gt;This works fine when posting same content through curl,  not sure if some limitation through splunk SDK.  Anyone have any idea on quick fix?&lt;/P&gt;

&lt;P&gt;File "/opt/splunk/etc/apps/adp_cmdb/bin/splunklib/client.py", line 3724, in batch_save&lt;BR /&gt;
    return json.loads(self._post('batch_save', headers=KVStoreCollectionData.JSON_HEADER, body=data).body.read().decode('utf-8'))&lt;BR /&gt;
  File "/opt/splunk/etc/apps/adp_cmdb/bin/splunklib/client.py", line 3615, in _post&lt;BR /&gt;
    return self.service.post(self.path + url, owner=self.owner, app=self.app, sharing=self.sharing, **kwargs)&lt;BR /&gt;
  File "/opt/splunk/etc/apps/adp_cmdb/bin/splunklib/binding.py", line 289, in wrapper&lt;BR /&gt;
    return request_fun(self, *args, **kwargs)&lt;BR /&gt;
  File "/opt/splunk/etc/apps/adp_cmdb/bin/splunklib/binding.py", line 71, in new_f&lt;BR /&gt;
    val = f(*args, **kwargs)&lt;BR /&gt;
  File "/opt/splunk/etc/apps/adp_cmdb/bin/splunklib/binding.py", line 742, in post&lt;BR /&gt;
    response = self.http.post(path, all_headers, **query)&lt;BR /&gt;
  File "/opt/splunk/etc/apps/adp_cmdb/bin/splunklib/binding.py", line 1208, in post&lt;BR /&gt;
    return self.request(url, message)&lt;BR /&gt;
  File "/opt/splunk/etc/apps/adp_cmdb/bin/splunklib/binding.py", line 1228, in request&lt;BR /&gt;
    raise HTTPError(response)&lt;BR /&gt;
splunklib.binding.HTTPError: HTTP 400 Bad Request -- The provided query was invalid.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:15:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Splunk-python-SDK-to-update-kvstore-error/m-p/417816#M7286</guid>
      <dc:creator>kyaparla</dc:creator>
      <dc:date>2020-09-29T20:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk python SDK to update kvstore error</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-python-SDK-to-update-kvstore-error/m-p/417817#M7287</link>
      <description>&lt;P&gt;When you call the client.data.batch_save() be sure to put an asterisk in front of your passed parameter.&lt;BR /&gt;
     client.data.batch_save(*data)&lt;/P&gt;

&lt;P&gt;You can see this in the unit tests: &lt;BR /&gt;
&lt;A href="https://github.com/splunk/splunk-sdk-python/blob/master/tests/test_kvstore_batch.py" target="_blank"&gt;https://github.com/splunk/splunk-sdk-python/blob/master/tests/test_kvstore_batch.py&lt;/A&gt;&lt;BR /&gt;
unit test: def test_insert_find_update_data(self):&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:55:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Splunk-python-SDK-to-update-kvstore-error/m-p/417817#M7287</guid>
      <dc:creator>jrouse025</dc:creator>
      <dc:date>2020-09-29T23:55:04Z</dc:date>
    </item>
  </channel>
</rss>

