Getting Data In

| rest /services/cluster/master/peers

_smp_
Builder

I have a SH cluster and an Index cluster all running 7.1.7. I'm trying to access the cluster/master/peers endpoint by executing this search:

| rest /services/cluster/master/peers

When I run this on a SH, I get this error:

REST Processor: Failed to fetch REST endpoint uri=https://127.0.0.1:8089/services/cluster/master/peers?count=0 from server https://127.0.0.1:8089. Check that the URI path provided exists in the REST API.
When I run it on the CM, I get this error:
Unexpected status for to fetch REST endpoint uri=https://127.0.0.1:8089/services/cluster/master/peers?count=0 from server=https://127.0.0.1:8089 - Service Unavailable
Either way, this message gets logged by each of the indexer peers no matter where I run the rest command:
10-16-2019 09:28:39.947 -0500 INFO ClusterMasterPeerHandler - master is not enabled on this node

Anyone know why I can't access this rest endpoint?

0 Karma
1 Solution

anthonymelita
Contributor

The rest endpoint you're hitting there is for indexer clustering and will only work on an indexer cluster master. If you are trying to get the status of all distributed search peers then use |rest /services/search/distributed/peers/

Also if you want to avoid errors from downstream search peers, then you should specify the splunk_server=
For the case of getting indexer cluster peers you would do like
|rest /services/cluster/master/peers splunk_server=ClusterMasterNameGoesHere and then it won't try to distribute the rest command to all search peers, and avoid them throwing errors.

View solution in original post

anthonymelita
Contributor

The rest endpoint you're hitting there is for indexer clustering and will only work on an indexer cluster master. If you are trying to get the status of all distributed search peers then use |rest /services/search/distributed/peers/

Also if you want to avoid errors from downstream search peers, then you should specify the splunk_server=
For the case of getting indexer cluster peers you would do like
|rest /services/cluster/master/peers splunk_server=ClusterMasterNameGoesHere and then it won't try to distribute the rest command to all search peers, and avoid them throwing errors.

_smp_
Builder

Thank you very much for the response. It does not work when I run the command on the CM - I posted the error above. But it does work when I add splunk_server=.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...