MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Splunk Tutorials: App Deployment Server

A Splunk deployment server keeps apps such as inputs.conf and outputs.conf in one central place and pushes them to universal forwarders, which check in regularly as deployment clients. This page covers the deployment server, server class and deployment client setup from the notes above, fixes the errors in that configuration, and shows how to confirm that the app reached the forwarder and that its data is getting indexed.


======Deployment Server=============
Create an App "testapp" under /home/ubuntu/splunk/etc/deployment-apps
Create a dir local & under local dir

inputs.conf
-------------------
[monitor://home/ubuntu/splaunkforwarder/var/log/splunk/splunkd.log]
index=web
sourcetype=splunkdlog

outputs.conf
---------------
[tcpout]
defaultGroup = splunkindexer
disabled = false
compress = true

[tcpout:splunkindexer]
server = 172.31.4.56.9997

/home/ubuntu/splunk/etc/system/local/serverclass.conf
[global]

[serverClass:NewApps]
[serverClass:NewApps:app:test:testapp]

======Deployment Client=============
/home/ubuntu/splunk/etc/system/local/

[deployment-client]

[target-broker:deploymentServer]
targeturi=172.31.12.3:8089
Code language: JavaScript (javascript)

CONFIGURE APP DEPLOYEMENT SERVER
=======================================================

In the forwarders machines
==================================
Do you find any file named with "deploymentclient.conf" in /opt/splunkforwarder/etc/system/local
> ./splunk set deploy-poll <IP_address/hostname>:<management_port>
# 8089
> splunk restart

OBSERRVATIONS:
Check 
/opt/splunkforwarder/etc/system/local
deploymentclient.conf

WNDOWS
targetUri = 13.126.48.167:8089



Configure deployment clients
http://docs.splunk.com/Documentation/Splunk/6.6.3/Updating/Configuredeploymentclients
https://docs.splunk.com/Documentation/Splunk/6.6.2/Admin/Deploymentclientconf


======Deployment Server=============
Create an App "testapp" under /home/ubuntu/splunk/etc/deployment-apps

Create a dir local & under local dir

inputs.conf
-------------------
[monitor://home/ubuntu/splaunkforwarder/var/log/splunk/splunkd.log]
index=web
sourcetype=splunkdlog


outputs.conf
---------------
[tcpout]
defaultGroup = splunkindexer
disabled = false
compress = true

[tcpout:splunkindexer]
server = 172.31.4.56.9997

/home/ubuntu/splunk/etc/system/local/serverclass.conf
[global]

[serverClass:NewApps]
[serverClass:NewApps:app:test:testapp]

======Deployment Client=============
/home/ubuntu/splunk/etc/system/local/

[deployment-client]

[target-broker:deploymentServer]
targeturi=172.31.12.3:8089Code language: PHP (php)

How the deployment server fits together

Three roles are involved. The deployment server (a full Splunk Enterprise instance) stores apps under $SPLUNK_HOME/etc/deployment-apps. The deployment clients (normally universal forwarders) poll the server on its management port, 8089 by default, and download whatever apps their server class gives them. The indexer receives the data that those apps tell the forwarder to collect, normally on port 9997.

RoleFileLocation
Deployment serverApp content (inputs.conf, outputs.conf)$SPLUNK_HOME/etc/deployment-apps/<app>/local/
Deployment serverserverclass.conf (which clients get which apps)$SPLUNK_HOME/etc/system/local/serverclass.conf
Forwarder (Linux)deploymentclient.conf/opt/splunkforwarder/etc/system/local/deploymentclient.conf
Forwarder (Windows)deploymentclient.confC:\Program Files\SplunkUniversalForwarder\etc\system\local\deploymentclient.conf
IndexerReceiving port and target indexsplunk enable listen 9997, index created in the UI or indexes.conf

Note: Network requirements: forwarders must be able to reach the deployment server on TCP 8089 and the indexer on TCP 9997. In AWS, open both ports in the relevant security groups.

Corrected configuration for the example above

Several lines in the example above will fail silently or get rejected by Splunk. Below is the corrected set of files, using the same IP addresses. In the original, the deployment server lives at /home/ubuntu/splunk. The forwarder is assumed to be at its default path, /opt/splunkforwarder.

# Deployment server: /home/ubuntu/splunk/etc/deployment-apps/testapp/local/inputs.conf
[monitor:///opt/splunkforwarder/var/log/splunk/splunkd.log]
index = web
sourcetype = splunkdlog
disabled = falseCode language: PHP (php)
# Deployment server: /home/ubuntu/splunk/etc/deployment-apps/testapp/local/outputs.conf
[tcpout]
defaultGroup = splunkindexer

[tcpout:splunkindexer]
server = 172.31.4.56:9997Code language: PHP (php)
# Deployment server: /home/ubuntu/splunk/etc/system/local/serverclass.conf
[global]

[serverClass:NewApps]
# Which clients belong to this class (IP, hostname or clientName; wildcards allowed)
whitelist.0 = 172.31.*

[serverClass:NewApps:app:testapp]
restartSplunkd = true
stateOnClient = enabledCode language: PHP (php)
# Forwarder: /opt/splunkforwarder/etc/system/local/deploymentclient.conf
[deployment-client]

[target-broker:deploymentServer]
targetUri = 172.31.12.3:8089Code language: PHP (php)
  • Monitor stanza: a monitor path needs three slashes (monitor:// followed by an absolute path that starts with /). The original also had the typo splaunkforwarder, so the path did not exist.
  • outputs.conf: 172.31.4.56.9997 is not a valid host:port. The port must follow a colon: 172.31.4.56:9997. The disabled and compress lines are optional. If you enable compress = true, the receiving input on the indexer needs the same setting, otherwise the connection fails.
  • serverclass.conf: the app stanza format is [serverClass:<class>:app:<app>]. The original [serverClass:NewApps:app:test:testapp] has an extra segment. The original also had no whitelist, so no client ever matched the class and nothing was deployed.
  • restartSplunkd = true: a forwarder only starts using new inputs and outputs after it restarts, so this setting tells it to restart once the app arrives.
  • deploymentclient.conf: this file goes on the forwarder, not in the deployment server's /home/ubuntu/splunk tree. The setting is targetUri, and Splunk setting names are case-sensitive.

Step-by-step lab

  1. On the indexer, turn on receiving and create the web index: /opt/splunk/bin/splunk enable listen 9997 -auth admin:<password>, then create the index under Settings > Indexes. Splunk drops events sent to an index that does not exist and logs a warning.
  2. On the deployment server, create the app: mkdir -p /home/ubuntu/splunk/etc/deployment-apps/testapp/local, then add the inputs.conf and outputs.conf shown above.
  3. Create /home/ubuntu/splunk/etc/system/local/serverclass.conf using the content above.
  4. Load the server classes: /home/ubuntu/splunk/bin/splunk reload deploy-server -auth admin:<password>. Run this every time you change an app or serverclass.conf.
  5. On each forwarder, point it at the deployment server. Either write deploymentclient.conf by hand or run the CLI command shown below.
  6. Restart the forwarder: /opt/splunkforwarder/bin/splunk restart. Within about a minute it phones home, downloads testapp and restarts itself because restartSplunkd = true is set.
cd /opt/splunkforwarder/bin
sudo ./splunk set deploy-poll 172.31.12.3:8089 -auth admin:<forwarder_password>
sudo ./splunk restartCode language: HTML, XML (xml)

set deploy-poll writes the [target-broker:deploymentServer] stanza with targetUri into etc/system/local/deploymentclient.conf. That is why the observations above say to check that file. On Windows, run splunk.exe set deploy-poll 13.126.48.167:8089 from C:\Program Files\SplunkUniversalForwarder\bin in an elevated prompt, then splunk.exe restart.

Verify the deployment

# On the forwarder: confirm the configured deployment server
/opt/splunkforwarder/bin/splunk show deploy-poll

# On the forwarder: confirm the app arrived
ls /opt/splunkforwarder/etc/apps/testapp/local

# On the forwarder: confirm the forwarding target is active
/opt/splunkforwarder/bin/splunk list forward-server

# On the deployment server: list clients that have phoned home
/home/ubuntu/splunk/bin/splunk list deploy-clients -auth admin:<password>Code language: PHP (php)

In Splunk Web on the deployment server, Settings > Forwarder Management lists each client, its server classes and the apps it has received. Once the forwarder restarts, run a search on the indexer or search head:

index=web sourcetype=splunkdlog | head 10

Note: A forwarder already sends its own splunkd.log to the _internal index by default. Monitoring that file again into web works fine for a lab, but in production, deploy inputs for real application logs instead.

Troubleshooting

SymptomLikely causeFix
Client never shows in Forwarder ManagementPort 8089 blocked, wrong targetUri, or forwarder not restartedRun curl -k https://172.31.12.3:8089 from the forwarder, check the security group, restart the forwarder
Client shows up but has no appsThe whitelist does not match the client, or the server was not reloadedFix whitelist.0, then run splunk reload deploy-server
App present on client but no dataBad monitor path, missing web index, or receiving not enabled on 9997Check splunk list monitor on the forwarder and index=_internal source=*splunkd.log* ERROR on the indexer
Forwarder logs TcpOutputProc connection errorsBad server value in outputs.conf, or a compression mismatchUse host:port format and make the compress setting match on both sides
Local edits on the client disappearThe deployment server overwrites deployed apps on each syncChange the app in deployment-apps on the server only

On the forwarder, the most useful log is /opt/splunkforwarder/var/log/splunk/splunkd.log. Search it for DeploymentClient, DC: and TcpOutputProc messages.

Best practices and security notes

  • Group clients into server classes by role or OS (for example linux_web, windows_dc) rather than putting everything into one class with a * whitelist. Use machineTypesFilter (for example linux-x86_64) so Windows inputs never reach Linux hosts.
  • Split outputs and inputs into separate apps, such as org_all_forwarder_outputs and org_web_inputs. That way you can change the indexer address once for every forwarder.
  • Never edit deployed apps directly on clients. Keep deployment-apps under version control and reload after each change.
  • Change the default admin password on forwarders. Restrict port 8089 on the deployment server to forwarder subnets only.
  • Do not make the deployment server a client of itself. A deployment server should not push apps to indexer clusters or search head clusters either, because those use the cluster manager and the deployer.
  • The Splunk 6.6 documentation links in the original are outdated. Use the current Splunk Enterprise documentation on updating Splunk Enterprise instances, which covers deploymentclient.conf and serverclass.conf. For more CLI commands, see the Splunk commands reference.

Frequently asked questions

What port does a Splunk deployment client use to reach the deployment server?

It uses the deployment server's management port, which is TCP 8089 by default. Data forwarding to indexers is separate and normally uses port 9997.

How often do deployment clients check for new apps?

By default they phone home every 60 seconds. You can change this with phoneHomeIntervalInSecs in the [deployment-client] stanza of deploymentclient.conf.

Do I need to restart the deployment server after editing serverclass.conf?

No. Run splunk reload deploy-server and the server picks up changes to serverclass.conf and to the apps in deployment-apps.

Why did my app deploy but the forwarder is not sending data?

Usually the forwarder was not restarted after the app arrived, so set restartSplunkd = true. Other common causes are a wrong monitor path, a target index that does not exist, or an indexer that is not listening on the receiving port.

Where does the deployed app end up on the forwarder?

In $SPLUNK_HOME/etc/apps/<app_name>, for example /opt/splunkforwarder/etc/apps/testapp. Any local edits there get overwritten on the next sync.

Related tutorials

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services โ€” all in one place.

Explore Hospitals

Related Posts

Splunk Tutorial: Install & Configure Universal Forwarders

The Splunk Universal Forwarder (UF) is a small agent that reads logs on a host and sends them to a Splunk indexer or to Splunk Cloud. The…

Read More

Splunk Tutorials: Download Splunk & Universal Forwarder

This page has direct wget commands that download Splunk Enterprise (the indexer and search head) and the Splunk Universal Forwarder as Windows MSI, Linux DEB, RPM and…

Read More

Splunk FAQ

How do I create source types for data originating from Forwarders? The Splunk platform does not support data preview through universal forwarders. Use a full Splunk platform…

Read More

Splunk Tutorial: Install & Configure Splunk Server (Indexer + Search Head + Universal forwarder)

Rajesh Kumar I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have…

Read More

Top 50 Splunk interview questions and answers

1) Define Splunk It is a software technology that is used for searching, visualizing, and monitoring machine-generated big data. It monitors and different types of log files…

Read More

Top Splunk interview questions and answers

What are the components of Splunk? There are 3 main components in Splunk: Splunk Forwarder, used for data forwarding. Splunk Indexer, used for Parsing and indexing the…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x