<?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: How to directly connect to kvstore using a mongodb client and bulk fill my kvstore with 3,000,000 entries? in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/How-to-directly-connect-to-kvstore-using-a-mongodb-client-and/m-p/142278#M1418</link>
    <description>&lt;P&gt;Thanks for you input on this. I actually missed the batch_save endpoint.&lt;/P&gt;

&lt;P&gt;For #2 and #3: One could use the kv store as an interface to master data systems. Moreover in a scenario where (critical) process data is stored within the kv store the customer might be interested in having a non-proprietary access to this kind of data.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jun 2015 08:48:28 GMT</pubDate>
    <dc:creator>bjoernjensen</dc:creator>
    <dc:date>2015-06-18T08:48:28Z</dc:date>
    <item>
      <title>How to directly connect to kvstore using a mongodb client and bulk fill my kvstore with 3,000,000 entries?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-directly-connect-to-kvstore-using-a-mongodb-client-and/m-p/142276#M1416</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;

&lt;P&gt;I would like to initially bulk fill my kvstore with around 3.000.000 entries.&lt;/P&gt;

&lt;P&gt;AFAIK the REST API allows to add one entry at a time. Not taking the overhead into account, this takes way too long.&lt;/P&gt;

&lt;P&gt;Therefore, I need a direct connection to the kvstore (mongo db 2.6.7-splunk). My first task then would be: "getting a list of all database objects (show dbs)".&lt;/P&gt;

&lt;P&gt;I tried using mongo shell 3.0.3. The connection could be established (to the db admin). But I am not allowed to do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;show db
"errmsg" : "not authorized on admin to execute command { listDatabases: 1.0 }",
"code" : 13
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I am connected not using any pem/key file.&lt;/P&gt;

&lt;P&gt;With node.js and the package mongodb, I use these options, since I found them in mongod.log:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;options: { net: { port: 8191, ssl: { PEMKeyFile: "xxx\etc\auth\server.pem", PEMKeyPassword: "&amp;lt;password&amp;gt;", mode: "preferSSL" } }, replication: { oplogSizeMB: 1000 }, security: { keyFile: "xxx\var\lib\splunk/kvstore\mongo\splunk.key" }, setParameter: { enableLocalhostAuthBypass: "0" }, storage: { dbPath: "xxx\var\lib\splunk/kvstore\mongo", smallFiles: true }, systemLog: { timeStampFormat: "iso8601-utc" } }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But same with this approach:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;AssertionError: null == {"name":"MongoError","message":"not authorized on admin to execute command { listDatabases: 1 }","ok":0,"errmsg":"not authorized
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My questions so far:&lt;/P&gt;

&lt;H1&gt;1 How can I bulk fill the kvstore?&lt;/H1&gt;

&lt;H1&gt;2 How can access the kvstore directly?&lt;/H1&gt;

&lt;H1&gt;3 (How) can I use my own mongodb as kvstore?&lt;/H1&gt;

&lt;P&gt;Thanks - Björn&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2015 07:06:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-directly-connect-to-kvstore-using-a-mongodb-client-and/m-p/142276#M1416</guid>
      <dc:creator>bjoernjensen</dc:creator>
      <dc:date>2015-06-04T07:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to directly connect to kvstore using a mongodb client and bulk fill my kvstore with 3,000,000 entries?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-directly-connect-to-kvstore-using-a-mongodb-client-and/m-p/142277#M1417</link>
      <description>&lt;OL&gt;
&lt;LI&gt;Two options:
a) you can use batch_save REST call &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/RESTREF/RESTkvstore#storage.2Fcollections.2Fdata.2F.7Bcollection.7D.2Fbatch_save" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.3/RESTREF/RESTkvstore#storage.2Fcollections.2Fdata.2F.7Bcollection.7D.2Fbatch_save&lt;/A&gt; It is limited by default to maximum of 1000 documents, so in your case it will take 3,000 calls.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;b) you can create a lookup for this collection, save your data into CSV file and migrate it from CSV into your kvstore collection by issuing a search like "| inputlookup myfile.csv | outputlookup mykvstorecollection_lookup"&lt;/P&gt;

&lt;P&gt;2 &amp;amp; 3. That is not supported. Even if you will find out how to make 2 and 3 work - there are will be a huge chance that not everything will work as you expect or something can be broken with following updates. Please let us know if you have some other reasons (other than #1) why would you like to have #2 and #3. &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 20:11:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-directly-connect-to-kvstore-using-a-mongodb-client-and/m-p/142277#M1417</guid>
      <dc:creator>dgladkikh_splun</dc:creator>
      <dc:date>2020-09-28T20:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to directly connect to kvstore using a mongodb client and bulk fill my kvstore with 3,000,000 entries?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-directly-connect-to-kvstore-using-a-mongodb-client-and/m-p/142278#M1418</link>
      <description>&lt;P&gt;Thanks for you input on this. I actually missed the batch_save endpoint.&lt;/P&gt;

&lt;P&gt;For #2 and #3: One could use the kv store as an interface to master data systems. Moreover in a scenario where (critical) process data is stored within the kv store the customer might be interested in having a non-proprietary access to this kind of data.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2015 08:48:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-directly-connect-to-kvstore-using-a-mongodb-client-and/m-p/142278#M1418</guid>
      <dc:creator>bjoernjensen</dc:creator>
      <dc:date>2015-06-18T08:48:28Z</dc:date>
    </item>
  </channel>
</rss>

