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!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...