deductiv / kvstore_tools

KV Store Tools Redux app for Splunk
https://www.deductiv.net
Other
3 stars 6 forks source link
backup restore splunk splunk-addon splunk-application

App icon KV Store Tools Redux - Splunk App by Deductiv

Utilities for the Splunk App Key-Value Store

Rewrite of Gemini KV Store Tools

The KV Store Tools for Splunk app includes the following features:

Generating Commands

[1]: Deletes the collections from the target host before writing (unless otherwise specified).


Command Usage

KV Store Backup

Back up a KV Store collection to disk on the local node. The backup process will write one or more .json or .json.gz files (one for each collection). For search head clusters, it's recommended to have a shared volume (e.g. NFS) among all nodes for backups to reliably enforce the retention policy and the kvstorerestore command functionality.

This functionality is implemented through a generating search command. Syntax:

| kvstorebackup app="app_name" collection="collection_name" path="/data/backup/kvstore" global_scope="false"  

Arguments:

KV Store Restore

Restore a KV Store collection backup file to the local node. Uses the filename to determine the app name and collection to write the data to. By default, the restore process will delete the KV Store collection and overwrite it with the contents of the backup unless append=true is set. Running the search command with no arguments will list existing backups in the default path.

This functionality is implemented through a generating search command. Syntax:

| kvstorerestore filename="/backup/kvstore/app_name#collection_name#20170130*"  

Arguments:

KV Store Push

Upload local KV Store collection(s) to one or more target instances. Configure your remote Splunk credentials in the Setup page. The replication process will delete the target KV Store collection and overwrite it with the local contents unless append=true is set.

This functionality is implemented through a generating search command. Syntax:

| kvstorepush app="<app_name>" collection="<collection_name>" global_scope="[true|false]" append="[true|false]" target="<remote_hosts>"  

Arguments:

KV Store Pull

Download local KV Store collection(s) from another instance to the local one. Configure your remote Splunk credentials in the Setup page. The replication process will delete the local KV Store collection and overwrite it with the remote contents unless append=true is set.

This functionality is implemented through a generating search command. Syntax:

| kvstorepull app="<app_name>" collection="<collection_name>" global_scope="[true|false]" append="[true|false]" target="<remote_host>"  

Arguments:

KV Store Create Foreign Key

Writes data from the search into a new KV store collection record and returns the record's _key value into the search as a new field. The _key value becomes a foreign key reference in the search results, which can be written to a second lookup using outputlookup.

This functionality is implemented through a streaming search command. Syntax (example):

search <events> | kvstorecreatefk collection="<collection1_name>" outputkeyfield="<key_field_name>" | outputlookup append=t <collection2_name>

Arguments:

KV Store Delete Keys

Delete multiple KV Store collection records based on the _key value from the search result input.

This functionality is implemented through a streaming search command. Syntax (example):

| inputlookup lookup_name where domain="*splunk.com" | deletekeys collection="collection_name"  

Arguments:

KV Store Delete Key

Deletes a specific record from a KV Store collection based on _key value.

This functionality is implemented through a generating search command. Syntax:

| deletekey collection="collection_name" key="key_value"  

Arguments: