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 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 notes above show how to set up a receiving port, install the forwarder, add a forward-server and monitor a log path. The sections below turn those notes into a complete, up-to-date procedure, with verification steps, troubleshooting and fixes for commands that no longer work on current Splunk versions.



How the universal forwarder fits into Splunk

A universal forwarder does not index or search data and has no web interface. It tails files, reads Windows event logs or runs scripted inputs, then streams the events over TCP to one or more indexers listening on a receiving port, usually 9997. You configure it from the splunk CLI or by editing inputs.conf (what to collect) and outputs.conf (where to send it).

PortWherePurpose
8000Indexer / search headSplunk Web (browser UI)
8089Indexer and forwardersplunkd management port (REST API, CLI, deployment server)
8065Indexer, localhost onlyInternal app server, not exposed
8191IndexerKV store
9997IndexerReceiving port for forwarder data (common convention, set by you)

Note: Only 9997 (and 8089 if you use a deployment server) needs to be reachable from forwarder hosts. Do not open 8065 or 8191 to the network.

Prepare the receiving indexer

The web UI steps above (Settings > Forwarding and receiving > Receive data) can also be done from the indexer's CLI. Either way, the indexer must listen on the port and the host firewall must allow it.

# On the indexer (full Splunk Enterprise install)
sudo -u splunk /opt/splunk/bin/splunk enable listen 9997 -auth admin:'YourAdminPass'

# Open the port: firewalld (RHEL, Rocky, Amazon Linux)
sudo firewall-cmd --permanent --add-port=9997/tcp
sudo firewall-cmd --reload

# or ufw (Ubuntu)
sudo ufw allow 9997/tcp

# Confirm splunkd is listening
sudo ss -ltnp | grep 9997Code language: PHP (php)

On AWS, Azure or GCP you also need a security group or network rule that allows inbound TCP 9997 from the forwarder subnets. A restart is not required after enable listen. Create any custom index (for example linux_logs) on the indexer before forwarders send data to it. Events sent to an index that does not exist are not stored, and the indexer logs a warning.

Install the forwarder on Linux

Get the current download link from the Universal Forwarder page on splunk.com (choose Linux, .tgz, .rpm or .deb). The page shows a ready-made wget command. Keep the forwarder version the same as your indexers or older. The steps below use the tarball and run the forwarder as a non-root user.

  1. Create a service account and extract the package into /opt. This creates /opt/splunkforwarder.
  2. Seed the admin password with user-seed.conf. Since Splunk 7.1 there is no default admin:changeme login, and the first start fails without a password.
  3. Start the forwarder once to accept the license, then stop it.
  4. Enable boot-start under systemd as the service account and start the SplunkForwarder service.
# 1. User and files (tar install)
sudo useradd -r -m -d /home/splunkfwd splunkfwd
cd /opt
sudo wget -O splunkforwarder.tgz "<URL copied from splunk.com>"
sudo tar -xzf splunkforwarder.tgz -C /opt
sudo chown -R splunkfwd:splunkfwd /opt/splunkforwarder

# 2. Seed the admin password (file is consumed and removed on first start)
sudo -u splunkfwd tee /opt/splunkforwarder/etc/system/local/user-seed.conf >/dev/null <<'EOF'
[user_info]
USERNAME = admin
PASSWORD = Ch4nge-Me-Str0ng!
EOF

# 3. First start
sudo -u splunkfwd /opt/splunkforwarder/bin/splunk start --accept-license --answer-yes --no-prompt
sudo -u splunkfwd /opt/splunkforwarder/bin/splunk stop

# 4. Boot start with systemd
sudo /opt/splunkforwarder/bin/splunk enable boot-start -user splunkfwd -systemd-managed 1
sudo systemctl start SplunkForwarder
sudo systemctl status SplunkForwarderCode language: PHP (php)

Note: With RPM or DEB packages (sudo rpm -i ...rpm or sudo dpkg -i ...deb), files also go to /opt/splunkforwarder. Recent package versions create a least-privileged splunkfwd user for you, so you can skip the useradd step.

Point the forwarder at the indexer and add inputs

cd /opt/splunkforwarder/bin
sudo -u splunkfwd ./splunk add forward-server 10.0.1.25:9997 -auth admin:'Ch4nge-Me-Str0ng!'
sudo -u splunkfwd ./splunk add monitor /var/log/messages -index main -sourcetype syslog
sudo -u splunkfwd ./splunk list forward-server
sudo -u splunkfwd ./splunk list monitorCode language: PHP (php)

Expected output of list forward-server once the connection works:

Active forwards:
	10.0.1.25:9997
Configured but inactive forwards:
	NoneCode language: CSS (css)

If the server is listed under Configured but inactive, the forwarder cannot reach the indexer. See the troubleshooting table. The CLI writes to /opt/splunkforwarder/etc/system/local/outputs.conf (the file shown at the end of the example above) and inputs.conf. In outputs.conf, defaultGroup names the target group, and server lists one or more indexers. With several indexers separated by commas, the forwarder load-balances between them automatically. The equivalent inputs.conf looks like this:

# /opt/splunkforwarder/etc/system/local/inputs.conf
[monitor:///var/log/messages]
index = main
sourcetype = syslog
disabled = false

[monitor:///var/log/nginx]
index = linux_logs
sourcetype = nginx:access
whitelist = access\.log$Code language: PHP (php)

Note: Because the forwarder runs as splunkfwd, it cannot read root-only files such as /var/log/secure or /var/log/messages on many distributions. Grant read access with ACLs, for example sudo setfacl -R -m u:splunkfwd:rX /var/log plus a default ACL (-d) so new files inherit it, instead of running the forwarder as root.

Sending data to Splunk Cloud

For Splunk Cloud you do not run add forward-server. In your Splunk Cloud stack, open the Universal Forwarder app and download the credentials package (splunkclouduf.spl). That package contains the outputs.conf, certificates and stack endpoints. Install it on the forwarder, restart, then add inputs:

cd /opt/splunkforwarder/bin
sudo -u splunkfwd ./splunk install app /tmp/splunkclouduf.spl -auth admin:'Ch4nge-Me-Str0ng!'
sudo -u splunkfwd ./splunk restart
sudo -u splunkfwd ./splunk add monitor /opt/log/www1 -index web -auth admin:'Ch4nge-Me-Str0ng!'Code language: JavaScript (javascript)

Splunk Cloud receives on TCP 9997 using TLS, so outbound 9997 must be allowed from the forwarder to the internet or through your proxy path.

Verify that data is arriving

Every forwarder sends its own internal logs to the _internal index. This works even when no other inputs are configured, so check it first. Run these searches on the indexer or search head:

index=_internal host=<forwarder-hostname> | stats count by source

index=_internal source=*metrics.log* group=tcpin_connections
| stats latest(_time) AS last_seen by hostname, sourceIp, version

index=main host=<forwarder-hostname> sourcetype=syslog | head 20Code language: HTML, XML (xml)

If _internal shows the forwarder but your monitored data does not appear, the connection is fine and the problem is the input: path, permissions or index name. The Monitoring Console Forwarders: Deployment dashboard only fills in after you enable forwarder monitoring as described above, and it updates on the schedule you choose (15 minutes in the example).

Troubleshooting common problems

SymptomLikely causeFix
Forward-server shown as inactiveIndexer not listening, firewall or security group blocking 9997ss -ltnp | grep 9997 on indexer; nc -vz <indexer> 9997 from forwarder; open the port
splunkd.log shows TcpOutputProc connection errorsWrong IP or port, or TLS mismatchCheck ./splunk btool outputs list --debug for the effective config
Forwarder connects but monitored data is missingUnreadable file, wrong path or nonexistent index./splunk list inputstatus; fix ACLs; create the index on the indexer
First start asks for a password or fails in scriptsNo default admin password on modern versionsUse user-seed.conf or --seed-passwd before the first start
Login failed on CLI commandsUsing admin:changeme from old guidesUse the password you seeded
Old file contents are not sent againThe forwarder already recorded the file as read (fishbucket)This is expected; re-sending requires a deliberate change such as crcSalt, which can cause duplicates

The forwarder's own log is /opt/splunkforwarder/var/log/splunk/splunkd.log. Running grep -iE 'TcpOutputProc|WARN|ERROR' splunkd.log | tail -50 finds most connection problems quickly.

Corrections to the original notes

  • wget wget -O ... contains a duplicated wget; it should be a single wget -O <file> "<url>".
  • The 7.2.5 DownloadActivityServlet link is obsolete and mixes versions with the 9.0.1 links. Download the current forwarder from splunk.com and match it to your indexer version.
  • cd /opt/splunk-dir/bin/ points to a directory that does not exist. The tarball extracts to /opt/splunkforwarder, so use cd /opt/splunkforwarder/bin.
  • Running ./splunk start before start --accept-license causes an interactive license prompt. Accept the license on the first start, and seed an admin password.
  • -auth admin:changeme no longer works: since Splunk 7.1 there is no default password. Set it with user-seed.conf or --seed-passwd.
  • The Linux section shows a Windows path for outputs.conf. On Linux the file is /opt/splunkforwarder/etc/system/local/outputs.conf. On Windows it is C:\Program Files\SplunkUniversalForwarder\etc\system\local\outputs.conf.
  • Running every command with sudo as root is discouraged. Run the forwarder as a dedicated non-root user and grant read access to logs with ACLs.
  • netstat is not installed by default on many current distributions; ss -tnp | grep 9997 gives the same information.
  • The git status output in the notes only shows which files the CLI changed (outputs.conf, inputs.conf, local.meta). It is not part of the procedure, and you do not need git on the forwarder.

Best practices

  • List at least two indexers in outputs.conf so the forwarder can load-balance and fail over between them, and consider useACK = true if you must not lose data in transit.
  • Manage many forwarders with a deployment server (port 8089) and deployment apps rather than editing etc/system/local on each host.
  • Enable TLS between forwarders and indexers for traffic that crosses untrusted networks.
  • Always set index and sourcetype explicitly on each input instead of relying on defaults.
  • Keep credentials out of shell history: prefer user-seed.conf and avoid passing -auth passwords on shared systems.

Frequently asked questions

What port does the Splunk Universal Forwarder use?

Forwarders send data to the indexer's receiving port, which is conventionally TCP 9997 and must be enabled on the indexer. The forwarder also has its own management port, 8089, used by the CLI and by the deployment server.

What is the default password for the Splunk Universal Forwarder?

Current versions have no default password. You must set the admin credentials on the first start with user-seed.conf, --seed-passwd, or the interactive prompt; the old admin:changeme login was removed in Splunk 7.1.

Where is outputs.conf on the universal forwarder?

Commands such as splunk add forward-server write it to /opt/splunkforwarder/etc/system/local/outputs.conf on Linux and to C:\Program Files\SplunkUniversalForwarder\etc\system\local\outputs.conf on Windows. Run splunk btool outputs list --debug to see the effective merged configuration.

Why does splunk list forward-server show my indexer as configured but inactive?

The forwarder cannot open a TCP connection to the indexer. Usually receiving is not enabled on the indexer, or a firewall or cloud security group blocks the port. Check with nc -vz <indexer> 9997 and look for TcpOutputProc errors in the forwarder's splunkd.log.

What is the difference between a universal and a heavy forwarder?

The universal forwarder is a lightweight agent that sends raw data without parsing it. A heavy forwarder is a full Splunk Enterprise instance that can parse, filter and route events before they reach the indexer, and it uses more resources.

Related tutorials

Find Trusted Cardiac Hospitals

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

Explore Hospitals

Related Posts

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…

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