<?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: Upload json array to KVStore in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Upload-json-array-to-KVStore/m-p/404333#M3536</link>
    <description>&lt;P&gt;Glad to help you  @potluri_88&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;!!Happy Splunking!!&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Jan 2019 13:16:03 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2019-01-16T13:16:03Z</dc:date>
    <item>
      <title>Upload json array to KVStore</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Upload-json-array-to-KVStore/m-p/404329#M3532</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to upload a json array with multiple objects to a kvstore using curl command as below.&lt;/P&gt;

&lt;P&gt;curl -k -u admin:**** &lt;A href="https://localhost:8089/servicesNS/nobody/test/storage/collections/data/hosts"&gt;https://localhost:8089/servicesNS/nobody/test/storage/collections/data/hosts&lt;/A&gt; -H 'Content-Type: application/json' -d '[{"env": "dev",  "zone": "Z1"},{"env": "dev",   "zone": "Z1"}]'&lt;/P&gt;

&lt;P&gt;Error is as below&lt;BR /&gt;
JSON in the request is invalid. (&lt;BR /&gt;
JSON parse error at offset 0 of file "[ {"env": "dev",   "zone": "Z1"},{   "env": "dev",    "zone": "Z1"}]": Expecting an object but got an array.&lt;/P&gt;

&lt;P&gt;How do upload multiple object json without using an array?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 17:47:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Upload-json-array-to-KVStore/m-p/404329#M3532</guid>
      <dc:creator>potluri_88</dc:creator>
      <dc:date>2019-01-14T17:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Upload json array to KVStore</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Upload-json-array-to-KVStore/m-p/404330#M3533</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Since your collection expects a certain JSON object you have to use curl multiple times.&lt;/P&gt;

&lt;P&gt;What should &lt;STRONG&gt;not&lt;/STRONG&gt; work: using an object that contains your array that contains your objects.&lt;/P&gt;

&lt;P&gt;Maybe that helps,&lt;BR /&gt;
Björn &lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 08:31:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Upload-json-array-to-KVStore/m-p/404330#M3533</guid>
      <dc:creator>bjoernjensen</dc:creator>
      <dc:date>2019-01-15T08:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Upload json array to KVStore</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Upload-json-array-to-KVStore/m-p/404331#M3534</link>
      <description>&lt;P&gt;@potluri_88&lt;/P&gt;

&lt;P&gt;Have you tried  &lt;CODE&gt;batch_save&lt;/CODE&gt; ??&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;storage/collections/data/{collection}/batch_save

POST: Run one or more save (insert and replace) operations in a specific collection
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Run multiple save operations:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Sample CURL Command:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -k -u admin:yourpassword \
    &lt;A href="https://localhost:8089/servicesNS/nobody/kvstoretest/storage/collections/data/kvstorecoll/batch_save" target="test_blank"&gt;https://localhost:8089/servicesNS/nobody/kvstoretest/storage/collections/data/kvstorecoll/batch_save&lt;/A&gt; \
    -H 'Content-Type: application/json' \
    -d '[{"name": "Splunk Sweden"}, {"name": "Splunk Singapore"}]'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Check below link for more info:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://dev.splunk.com/view/webframework-developapps/SP-CAAAEZG"&gt;http://dev.splunk.com/view/webframework-developapps/SP-CAAAEZG&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 12:47:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Upload-json-array-to-KVStore/m-p/404331#M3534</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-01-16T12:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: Upload json array to KVStore</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Upload-json-array-to-KVStore/m-p/404332#M3535</link>
      <description>&lt;P&gt;This really helped @kamlesh_vaghela .. thanks for your time..&lt;/P&gt;

&lt;P&gt;Cheers!!&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 13:10:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Upload-json-array-to-KVStore/m-p/404332#M3535</guid>
      <dc:creator>potluri_88</dc:creator>
      <dc:date>2019-01-16T13:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Upload json array to KVStore</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Upload-json-array-to-KVStore/m-p/404333#M3536</link>
      <description>&lt;P&gt;Glad to help you  @potluri_88&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;!!Happy Splunking!!&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 13:16:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Upload-json-array-to-KVStore/m-p/404333#M3536</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-01-16T13:16:03Z</dc:date>
    </item>
  </channel>
</rss>

