Splunk Search

How to backup the search queries of a user/admin in splunk ?

ppilla
Engager

How to backup the search queries of a user/admin in splunk ?
How to backup all the search queries of a user or admin in splunk enterprise.

Tags (1)
0 Karma

DavidHourani
Super Champion

Hi @ppilla,

It's very important to keep a backup of all the searches you use. There's an official documentation on how to backup Splunk knowledge objects that you can find here :
https://docs.splunk.com/Documentation/CoE/ssf/Handbook/ConfigBackup
https://docs.splunk.com/Documentation/Splunk/7.2.6/Admin/Backupconfigurations

Also if you want to go through all the searches that have been executed on Splunk then you can have a look at the _audit index.

Cheers,
David

0 Karma

koshyk
Super Champion

Splunk stores all the auditTrail (searches/savedsearches etc.). It is stored under index=_audit

A simple search would be

(index=_audit search_group=* action=search sourcetype=audittrail search_id!="rsa_*")
| fillnull value=NA search 
| stats count by user,search

But you can extend it to any fields

So if you need to backup, you can
1. backup the whole _audit index
2. Run a specific query on regular basis and do an outputlookup to a CSV file and back this up.

0 Karma

adonio
Ultra Champion

you have the queries saved for a certain amount of time
you can click on Expand your search history
another option will be to run the history command and collect to a summary index on a regular basis
see links:
https://docs.splunk.com/Documentation/Splunk/7.2.6/Search/Interactivesearchhistory
https://docs.splunk.com/Documentation/Splunk/7.2.6/SearchReference/History

hope it helps

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...