Splunk Search

How to get specify record from kV store using splunkjs and REST endpoint

abdullawells89
New Member

I am storing records into KV store/delete using SplunkJS and REST endpoints
Store
service.request(
"storage/collections/data/mycollection/",
"POST",
null,
null,
JSON.stringify(record),
{"Content-Type": "application/json"},
null)
.done(function() {
// Run the search again to update the table
search1.startSearch();

                    // Clear the form fields 
                    $("#formCustomerInfo input[type=text]").val("*"); 
           });

Delete

    $("#deleteRecord").click(function() {
        // Get the value of the key ID field
        var tokens = mvc.Components.get("default");
        var form_keyid = tokens.get("KeyID");

        // Delete the record that corresponds to the key ID using
        // the del method to send a DELETE request
        // to the storage/collections/data/{collection}/ endpoint
        service.del("storage/collections/data/mycollection/" + encodeURIComponent(form_keyid))

I need methods to get specific records to check the availability if the record in the KV store before storing it.
And I need a method to run the query in a specific query in a different tab based on the tokens provided
Ex:
app/search/customer?form.CustID=1&form.CustName=Kalyan_New&form.CustStreet=US&form.CustCity=US&form.CustState=US&form.CustZip=US&earliest=0&latest=&form.KeyID=5c4ef7a7b9d3520f1c004b55

Tags (1)
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 ...