Knowledge Management

How to upload large json format data into kv-store?

rashid47010
Communicator

Hi, everyone,

The customer shared one last JSON formatted file. there are more than 1000 records. Customers want it as a lookup. my thought process is saying that I should use the kV-store approach. but how can I upload a large amount of data into the kV store?

 

Labels (1)
Tags (2)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@rashid47010 

You can store JSON data using KVStore REST API.

Please go through  https://dev.splunk.com/enterprise/docs/developapps/manageknowledge/kvstore/usetherestapitomanagekv and check the Run multiple save operations section.

I have tried the below JSON with my curl command. You can try it in a local machine and validate the data.

 

[{
	"id": "1",
	"name": "Splunk Sweden"
}, {
	"id": "2",
	"name": "Splunk Singapore"
}]

 

Curl

 

curl -k -u admin:admin123     https://localhost:8089/servicesNS/nobody/APP_NAME/storage/collections/data/KV_STORE_COLLECTION/batch_save     -H 'Content-Type: application/json'     -d 'VALID_JSON_DATA'

 

My example Curl.

curl -k -u admin:admin123     https://localhost:8089/servicesNS/nobody/search/storage/collections/data/kvstorecoll/batch_save     -H 'Content-Type: application/json'     -d '[{"id":"1","name": "Splunk Sweden"}, {"id":"2","name": "Splunk Singapore"}]'

 

I hope this will help you.

 

Thanks
KV


If any of my replies help you to solve the problem Or gain knowledge, an upvote would be appreciated.

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...