Installation

CLI help

magnuscowie80
Explorer

Hi everyone, does anyone know a way of running splunk admin commands via a script. I need to run ./splunk reload deploy-server via cron job

Labels (1)

vikramyadav
Contributor

Hi @magnuscowie80 , you can automate Splunk deployment by using ansible. You can integrate ansible and Splunk that will be much efficient and easier than the script.

--------------------------------------------------------

If this helps your like will be appreciated😀



richgalloway
SplunkTrust
SplunkTrust

If you can type it on the command line then you should be able to put it in a script.  Just be sure to include credentials with commands that need them.

/opt/splunk/bin/splunk reload deploy-server -auth user:password
---
If this reply helps you, Karma would be appreciated.

isoutamo
SplunkTrust
SplunkTrust
The biggest issue would be, how to secure your credentials, so other cannot see those and use later on.
One way to do this is e.g. use ansible tower with callback on source node and then use ansible vault to store/crypt credentials. I suppose that there are some other ways too to do it.
r. Ismo
0 Karma

magnuscowie80
Explorer

That is the issue, securing my your credentials, I am guessing am going to be learning ansible.. thanks for the reply

0 Karma

isoutamo
SplunkTrust
SplunkTrust
Just look ansible attribute no_log and use ansible vault to secure your credentials and passwords on your repositories.
0 Karma
Get Updates on the Splunk Community!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...