Splunk Search

Is there an easy way to update a record in KV Store from the results of a Splunk search instead of bulk reloading a lookup table?

clyde772
Communicator

It seems using KV store from migrating from lookups seems to be very easy. Just outputlookup to a KV store stanza. But Is there an easy way to update a record, instead of just bulk reloading of a lookup table. For example, I would like to update a field for a record in KV store from the results from a Splunk search.

sundareshr
Legend

dgladkikh_splun
Splunk Employee
Splunk Employee

Please take a look on http://dev.splunk.com/view/SP-CAAAEZH

By default, each KV Store record has a
unique key ID, which is stored in the
internal "_key" field. When you use
outputlookup to write to the KV Store,
a key ID is autogenerated if you don't
specify one explicitly. If you want to
modify a specific record, you need to
provide its key ID.

So to do what you want you need: a) know _key field b) use append=True c) have the whole record (not just one field), because outputlookup with append=true will replace existing document with specified _key.

TonyLeeVT
Builder

Would really appreciate an example one-liner. Thanks!

jagadeeshm
Contributor

yeah, is there an example?

clyde772
Communicator

Thanks! dgladkikh_splunk!!

Get Updates on the Splunk Community!

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 ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...