Deployment Architecture

Can you programmattically add servers to an existing server-class?

a212830
Champion

Hi,

In our private cloud, we use chef to push out Splunk configs, which to this point, have been controlled by the Splunk team. We have a request to allow customers to push out their own installs (via chef, which we would control), but my bigger question is how can we add servers to a server-class programmatically? Is there a way to do that?

0 Karma
1 Solution

MuS
SplunkTrust
SplunkTrust

ppablo
Retired

Hi @a212830

Glad you found 2 great answers from @Mus and @d below. Don't forget to accept one of their answers to resolve this post please. Thanks!

Patrick

0 Karma

MuS
SplunkTrust
SplunkTrust

Hi a212830,

Yes, you can use the REST API to do so, see docs http://docs.splunk.com/Documentation/Splunk/6.2.1/RESTREF/RESTdeploy#deployment.2Fserver.2Fservercla...

cheers, MuS

_d_
Splunk Employee
Splunk Employee

There are a couple of ways. You can create a script that simply insert a sequential whitelist/blacklist attribute under each serverclass for the server/host in question in serverclass.conf (in your Deployment Server). Then follow it with a reload for that class so that its changes go in effect.

whitelist.<n> = <clientName> | <IP address> | <hostname>
blacklist.<n> = <clientName> | <IP address> | <hostname>

Or, a better alternative is to hit Deployment Server's corresponding REST endpoint and POST the whitelist/blacklist under the proper serverclass.

http://docs.splunk.com/Documentation/Splunk/6.2.1/RESTREF/RESTdeployExamples#deployment.2Fserver.2Fs...

a212830
Champion

Fantastic. Thanks!

0 Karma
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...