<?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: Python SDK and KVStore in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-create-a-KVStore-using-Python-SDK-w-SPL-commands/m-p/461464#M8397</link>
    <description>&lt;P&gt;I figured it out, thank you very much&lt;BR /&gt;
Here is enough code to be able to figure it out for anyone else who might stumble upon this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;kv = splunk.kvstore
kv.create(name="kvtestcollection", fields={"_key": "string", "name": "string"}, owner="nobody", sharing="system")
kv["kvtestcollection"].data.insert(json.dumps({"_key": "hello", "name": "world"}))
#kv["kvtestcollection"].delete()
transforms = splunk.confs["transforms"]
transforms.create(name="kvtestcollection_lookup", **{"external_type": "kvstore", "collection": "kvtestcollection", "fields_list": "_key, name", "owner": "nobody"})
#transforms["kvtestcollection_lookup"].delete()
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 26 Aug 2019 19:46:37 GMT</pubDate>
    <dc:creator>yurippe</dc:creator>
    <dc:date>2019-08-26T19:46:37Z</dc:date>
    <item>
      <title>How to create a KVStore using Python SDK w/ SPL commands?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-create-a-KVStore-using-Python-SDK-w-SPL-commands/m-p/461461#M8394</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;I am trying to create a kvstore that I can use in a &lt;CODE&gt;| inputlookup&lt;/CODE&gt; and / or &lt;CODE&gt;| lookup&lt;/CODE&gt; SPL command. I can create a KVStore using the python SDK, but it can not be used with the above commands.&lt;BR /&gt;(I have tried many things and variations in the create command, but this is what I assume to be the most correct:)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;gt;&amp;gt;&amp;gt; splunk.kvstore.create(name="testkvstore", **{"sharing": "global"})
{'status': 201, ...}
&amp;gt;&amp;gt;&amp;gt; splunk.kvstore["testkvstore"].data.app
'system'
&amp;gt;&amp;gt;&amp;gt; splunk.kvstore["testkvstore"].data.sharing
'system'
&amp;gt;&amp;gt;&amp;gt; splunk.kvstore["testkvstore"].data.owner
'nobody'

&amp;gt;&amp;gt;&amp;gt; splunk.kvstore["testkvstore"].data.insert(json.dumps({"_key": "test", "value": "result"}))
{'_key': 'test'}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Yet I cannot find it with &lt;CODE&gt;inputlookup&lt;/CODE&gt; nor &lt;CODE&gt;lookup&lt;/CODE&gt;. This does not work in splunk cloud nor local instance&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 20:52:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-create-a-KVStore-using-Python-SDK-w-SPL-commands/m-p/461461#M8394</guid>
      <dc:creator>yurippe</dc:creator>
      <dc:date>2020-06-17T20:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: Python SDK and KVStore</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-create-a-KVStore-using-Python-SDK-w-SPL-commands/m-p/461462#M8395</link>
      <description>&lt;P&gt;Did you create a transforms stanza to reference the kvstore collection?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 18:26:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-create-a-KVStore-using-Python-SDK-w-SPL-commands/m-p/461462#M8395</guid>
      <dc:creator>starcher</dc:creator>
      <dc:date>2019-08-26T18:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Python SDK and KVStore</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-create-a-KVStore-using-Python-SDK-w-SPL-commands/m-p/461463#M8396</link>
      <description>&lt;P&gt;No, any tips on how I would do this via the RESP API ?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 18:56:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-create-a-KVStore-using-Python-SDK-w-SPL-commands/m-p/461463#M8396</guid>
      <dc:creator>yurippe</dc:creator>
      <dc:date>2019-08-26T18:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Python SDK and KVStore</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-create-a-KVStore-using-Python-SDK-w-SPL-commands/m-p/461464#M8397</link>
      <description>&lt;P&gt;I figured it out, thank you very much&lt;BR /&gt;
Here is enough code to be able to figure it out for anyone else who might stumble upon this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;kv = splunk.kvstore
kv.create(name="kvtestcollection", fields={"_key": "string", "name": "string"}, owner="nobody", sharing="system")
kv["kvtestcollection"].data.insert(json.dumps({"_key": "hello", "name": "world"}))
#kv["kvtestcollection"].delete()
transforms = splunk.confs["transforms"]
transforms.create(name="kvtestcollection_lookup", **{"external_type": "kvstore", "collection": "kvtestcollection", "fields_list": "_key, name", "owner": "nobody"})
#transforms["kvtestcollection_lookup"].delete()
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Aug 2019 19:46:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-create-a-KVStore-using-Python-SDK-w-SPL-commands/m-p/461464#M8397</guid>
      <dc:creator>yurippe</dc:creator>
      <dc:date>2019-08-26T19:46:37Z</dc:date>
    </item>
  </channel>
</rss>

