Splunk Search

Rest search command query a separate Splunk instance

rdownie
Communicator

I have a need to be able to do a search in the Splunk UI using the Rest search command against a completely different instance of Splunk. I see the options allow you to specify a splunk server, is that only within your splunk environment? I don't see a mechanism to include a username or password. I know you can do this with the Rest API utilizing python but would like to be able to pull directly from the Splunk interface without writing an external command to do it. Any ideas?
Thanks,
-Bob

Tags (2)

Damien_Dallimor
Ultra Champion

You can use the REST API Modular Input to poll data from any REST endpoint , including remote Splunk instances.

tweaktubbie
Communicator

App has moved (URL) 😉 I'm wondering if there's an equivalent of all the curl solutions in a search query format - not from the CLI but the UI, as I have more or less the same question as topicstarter.

On my webinterface of the heavy forwarder, I'd like to run a (remote) saved search on the search head, to check for the license usage and if >99% stop the heavy forwarding mechanism. This works fine on my testing environment with a single instance machine performing all splunk functionalities on 1 machine.
I can run a CLI sh file connecting and executing the search, but a security issue is I have to plain text include admin:password in the file as every splunk server has its own credentials. Also, on the production environment I don't want to create scripts on the commandline; the general idea is to keep all in the UI and saved searches and prevent prompt access to files.

So in brief: does something like "| rest endpoint=searchheaduriorname:8089 | search /services/somequeryremotely" exist, or is it intentionally or not made available with REST?

Ayn
Legend

Nope, you can't query non-related Splunk instances from the web interface - unless you write your own custom command for doing something like that. You can, obviously, query Splunk instances that have been added as search peers, though.

bmacias84
Champion

This is very unfortunate, since the SOS app uses it for licensing. Licenser is not a part of search pool.

0 Karma

rdownie
Communicator

Thanks, that is what I suspected. Unfortunately the Splunk instance is embedded in a product that only allows you accees through Rest. I guess using python to write a command through the Rest API is the best option.

0 Karma

HiroshiSatoh
Champion

What about in the "Distributed search"?

HiroshiSatoh
Champion

It I wanted to try because I can set from the GUI.

0 Karma

rdownie
Communicator

Unfortunately, I don't believe I can add the other Splunk instance as a search peer.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...