<?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 Return only some key from KvStore through API. in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Return-only-some-key-from-KvStore-through-API/m-p/440532#M3902</link>
    <description>&lt;P&gt;Hi Splunkers,&lt;/P&gt;

&lt;P&gt;In order to update, delete or create entries in KvStore only when it's necessary, i'm looking to get the list of "_key" fields of a collections to compare them with the set of new "_key". And all of that with the REST API. &lt;/P&gt;

&lt;P&gt;Is there any solution without usage of search ?&lt;/P&gt;

&lt;P&gt;Thank's you for your awnser &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt; &lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 23:02:52 GMT</pubDate>
    <dc:creator>ater49</dc:creator>
    <dc:date>2020-09-29T23:02:52Z</dc:date>
    <item>
      <title>Return only some key from KvStore through API.</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Return-only-some-key-from-KvStore-through-API/m-p/440532#M3902</link>
      <description>&lt;P&gt;Hi Splunkers,&lt;/P&gt;

&lt;P&gt;In order to update, delete or create entries in KvStore only when it's necessary, i'm looking to get the list of "_key" fields of a collections to compare them with the set of new "_key". And all of that with the REST API. &lt;/P&gt;

&lt;P&gt;Is there any solution without usage of search ?&lt;/P&gt;

&lt;P&gt;Thank's you for your awnser &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:02:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Return-only-some-key-from-KvStore-through-API/m-p/440532#M3902</guid>
      <dc:creator>ater49</dc:creator>
      <dc:date>2020-09-29T23:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Return only some key from KvStore through API.</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Return-only-some-key-from-KvStore-through-API/m-p/440533#M3903</link>
      <description>&lt;P&gt;If you want to see &lt;CODE&gt;_key&lt;/CODE&gt;, you will need to rename it like so:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;|inputlookup kvstore_collection | eval key = _key | table  *&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 19:29:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Return-only-some-key-from-KvStore-through-API/m-p/440533#M3903</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-01-31T19:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Return only some key from KvStore through API.</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Return-only-some-key-from-KvStore-through-API/m-p/440534#M3904</link>
      <description>&lt;P&gt;HI,&lt;BR /&gt;
You can use &lt;STRONG&gt;query&lt;/STRONG&gt; parameter in the the GET request&lt;BR /&gt;
for example: when you will be  running &lt;BR /&gt;
&lt;CODE&gt;curl -X GET https://SPLUNK_SH:8089/servicesNS/nobody/SH_APP/storage/collections/data/KVSTORE_COLL?query={%20%22$and%22:%20[{%22def_id%22:{%22$gt%22:1049}},{%22def_id%22:{%22$lt%22:1060}},{%22sla_status%22:%220%22}]}&lt;/CODE&gt;&lt;BR /&gt;
it is an URL encoded &lt;CODE&gt;{ "$and": [{"def_id":{"$gt":1049}},{"def_id":{"$lt":1060}},{"sla_status":"0"}]}&lt;/CODE&gt; query, and you will get all the items that their def_id  is 1050-1060 AND sla_status = 0.&lt;BR /&gt;
Once you have the _key of all the items you want update, just submit the new full content of the items, since it's actually overwrite, and there is no update as such, you will need to re-submit all the "data" fields with their values&lt;/P&gt;

&lt;P&gt;For more information please refer (to the official documentation) here &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTkvstore#Queries" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTkvstore#Queries&lt;/A&gt; or (my understanding) here &lt;A href="http://isbyr.com/splunk-kv-store-using-rest-api/" target="_blank"&gt;http://isbyr.com/splunk-kv-store-using-rest-api/&lt;/A&gt;&lt;BR /&gt;
Regards,&lt;BR /&gt;
ILYA&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:43:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Return-only-some-key-from-KvStore-through-API/m-p/440534#M3904</guid>
      <dc:creator>ilyaresh</dc:creator>
      <dc:date>2020-09-29T23:43:10Z</dc:date>
    </item>
  </channel>
</rss>

