Getting Data In

Execute a command through the CLI on a remote system

eden881
Path Finder

When I run splunk cmd, I can execute any external system command using Splunk's context.
I want to combine that with the -uri parameter to be able to send remote commands to Universal Forwarders.

However the cmd engine treats -uri as a part of the command itself, for example:

splunk cmd dir -uri https://uf_hostname:8089
dir: cannot access https\://uf_hostname\:8089: No such file or directory

How can I send the command to a remote Splunk instance?

0 Karma

anfis
Observer

Hi, you might want to look at clustershell for this functionality. It's a little tricky to configure but runs nicely on all kind of lx clusters
see https://clustershell.readthedocs.io/en/latest/ for details and sources...

0 Karma

eden881
Path Finder

Thank you for the answer! Unfortunately I was looking for a way to achieve this via Splunk's components only, as those are already deployed on our servers.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Create an app with a scripted input containing that command. Push the app to the desired UFs.

---
If this reply helps you, Karma would be appreciated.
0 Karma

eden881
Path Finder

Thank you for the answer, but this method is extremely inconvenient as it requires a lot of effort and time to issue a single command.
I'm looking for a semi-interactive way to make use of my existing Splunk deployment to perform simple management tasks in my environment, without the need to fully connect to the server.

0 Karma
Get Updates on the Splunk Community!

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...