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 Splunk Server

This page shows how to download, install and start Splunk Enterprise on Linux from the .tgz, .rpm or .deb package, and how to run it as a systemd service under a non-root user. Below the original command list you will find a corrected step-by-step procedure, first-login and firewall setup, a quick universal forwarder connection, and fixes for common installation problems.


Download File URL - https://download.splunk.com/products/splunk/releases/9.0.1/linux/splunk-9.0.1-82c987350fde-Linux-x86_64.tgz

Splunk Linux Tar file - wget -O splunk-9.0.1-82c987350fde-Linux-x86_64.tgz "https://download.splunk.com/products/splunk/releases/9.0.1/linux/splunk-9.0.1-82c987350fde-Linux-x86_64.tgz"

Splunk Linux rpm file - wget -O splunk-9.0.1-82c987350fde-linux-2.6-x86_64.rpm "https://download.splunk.com/products/splunk/releases/9.0.1/linux/splunk-9.0.1-82c987350fde-linux-2.6-x86_64.rpm"

Splunk Linux Debian file - wget -O splunk-9.0.1-82c987350fde-linux-2.6-amd64.deb "https://download.splunk.com/products/splunk/releases/9.0.1/linux/splunk-9.0.1-82c987350fde-linux-2.6-amd64.deb"

Splunk Linux Windows file - wget -O splunk-9.0.1-82c987350fde-x64-release.msi "https://download.splunk.com/products/splunk/releases/9.0.1/windows/splunk-9.0.1-82c987350fde-x64-release.msi"


Splunk Universal Forwarder

MSI file
$ wget -O splunkforwarder-9.0.1-82c987350fde-x64-release.msi "https://download.splunk.com/products/universalforwarder/releases/9.0.1/windows/splunkforwarder-9.0.1-82c987350fde-x64-release.msi"

Linux tar file
$ wget -O splunkforwarder-9.0.1-82c987350fde-Linux-x86_64.tgz "https://download.splunk.com/products/universalforwarder/releases/9.0.1/linux/splunkforwarder-9.0.1-82c987350fde-Linux-x86_64.tgz"
Code language: JavaScript (javascript)

cd /opt/
wget XXXXX

tar xvzf splunk_package_name.tgz
tar xvzf splunk_package_name.tgz -C /opt
chmod 744 splunk_package_name.rpm
rpm -i splunk_package_name.rpm
./splunk start --accept-license
./splunk enable boot-start 
---
cd <Splunk Enterprise installation directory>/bin
./splunk start


cd /opt/splunk
dpkg -i splunk_package_name.deb
dpkg --status splunk
dpkg --list
./splunk start --accept-license
./splunk enable boot-start Code language: HTML, XML (xml)


What you are installing

The download links above cover two products. Splunk Enterprise is the full server: it indexes data, runs searches and serves the web interface. The Universal Forwarder is a lightweight agent that runs on your source machines and ships logs to Splunk Enterprise. Install Enterprise first, then add forwarders.

ItemSplunk EnterpriseUniversal Forwarder
Default install path (Linux)/opt/splunk/opt/splunkforwarder
Web interfacePort 8000 (HTTP by default)None
Management/REST port80898089
Receives forwarded dataPort 9997, once you enable itSends to 9997
Package formatstgz, rpm, deb, msitgz, rpm, deb, msi

Note: Version 9.0.1 in the example above is an old release. Sign in to splunk.com with a free account, open the Splunk Enterprise download page, and copy the current wget link it gives you. Package file names have changed between releases, so the commands below use <version> and <build> placeholders.

Prerequisites

  • A 64-bit Linux host that the current Splunk release supports, with sudo access.
  • Enough free disk space on the partition holding /opt/splunk. By default, Splunk stops indexing when free space falls below 5000 MB (minFreeSpace in server.conf).
  • Inbound TCP 8000 (web UI) open to your workstation. Open 9997 too if forwarders will send data.
  • A dedicated non-root splunk user. Running Splunk as root works, but it is a security risk and Splunk advises against it.
  • Raised file and process limits (Splunk recommends at least 64000 open files and 16000 user processes). Transparent huge pages should be disabled.
# Create the service account if it does not exist
id splunk || sudo useradd -r -m -s /bin/bash splunk

# Check and disable transparent huge pages (lasts until the next reboot)
cat /sys/kernel/mm/transparent_hugepage/enabled
echo never | sudo tee /sys/kernel/mm/transparent_hugepage/enabled
echo never | sudo tee /sys/kernel/mm/transparent_hugepage/defragCode language: PHP (php)

Note: The THP change above does not survive a reboot. To make it permanent, use a kernel boot parameter (transparent_hugepage=never) or a small systemd unit that runs before Splunkd.

Install from the tgz archive (any distribution)

  1. Download the archive to a temporary directory, not into /opt.
  2. Extract it into /opt. This creates /opt/splunk.
  3. Give ownership to the splunk user.
  4. Start Splunk as that user and accept the license. On first start, Splunk asks you to create the admin username and password.
cd /tmp
wget -O splunk-<version>-<build>-linux.tgz "<link copied from splunk.com>"

sudo tar -xzf splunk-<version>-<build>-linux.tgz -C /opt
sudo chown -R splunk:splunk /opt/splunk

sudo -u splunk /opt/splunk/bin/splunk start --accept-licenseCode language: HTML, XML (xml)

For automated builds (scripts, Ansible, cloud-init), skip the prompts and set the admin password in the same command:

sudo -u splunk /opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt --seed-passwd 'Use-A-Strong-Passw0rd'Code language: JavaScript (javascript)

Note: --seed-passwd leaves the password in your shell history. In automation, the safer option is to create /opt/splunk/etc/system/local/user-seed.conf before the first start. It holds a [user_info] stanza with USERNAME and PASSWORD (or HASHED_PASSWORD), and Splunk removes the file after it reads it.

Install from the rpm or deb package

Both packages install to /opt/splunk. Run the package command from the directory where you saved the file. /opt/splunk does not exist until the install finishes. The package installs files but does not start Splunk.

# RHEL, Rocky, Alma, Amazon Linux, SUSE
cd /tmp
sudo rpm -i splunk-<version>-<build>.x86_64.rpm      # or: sudo dnf install ./splunk-*.rpm
rpm -qi splunk

# Debian, Ubuntu
cd /tmp
sudo dpkg -i splunk-<version>-<build>-linux-amd64.deb
dpkg --status splunk

# Both: fix ownership and start
sudo chown -R splunk:splunk /opt/splunk
sudo -u splunk /opt/splunk/bin/splunk start --accept-licenseCode language: HTML, XML (xml)

Run rpm -qi splunk or dpkg --status splunk to confirm the package and version are installed. dpkg --list with no argument lists every package on the system, so use dpkg -l splunk if you only want the Splunk entry.

Start Splunk at boot with systemd

enable boot-start must run as root. Without -user, the service runs as root. Add -systemd-managed 1 so Splunk creates a native systemd unit (named Splunkd.service by default) instead of an init.d script. Stop Splunk before you enable it.

sudo -u splunk /opt/splunk/bin/splunk stop
sudo /opt/splunk/bin/splunk enable boot-start -user splunk -systemd-managed 1

sudo systemctl start Splunkd
sudo systemctl status Splunkd
systemctl cat Splunkd        # review the generated unit, including its resource limitsCode language: PHP (php)

After this, manage the service with systemctl start|stop|restart Splunkd. That keeps systemd's view of the process accurate.

Verify the installation and log in

/opt/splunk/bin/splunk version
sudo -u splunk /opt/splunk/bin/splunk status
sudo ss -tlnp | grep -E ':8000|:8089'

# Open the web port (firewalld)
sudo firewall-cmd --permanent --add-port=8000/tcp --add-port=9997/tcp
sudo firewall-cmd --reload

# Or on Ubuntu with ufw
sudo ufw allow 8000/tcp
sudo ufw allow 9997/tcpCode language: PHP (php)

splunk status should report that splunkd is running and list its process IDs. Open http://<server-ip>:8000 and sign in with the admin account you created. On a cloud VM, open port 8000 in the security group or network firewall too. A new install runs a 60-day Enterprise trial. After that you can switch to the Free license, which has a 500 MB/day indexing limit and no user authentication.

Note: The web UI uses plain HTTP by default. Before real use, enable HTTPS under Settings > Server settings > General settings, or set enableSplunkWebSSL = true in web.conf, and limit port 8000 to trusted networks.

Connect a universal forwarder

To send logs from another Linux host, enable a receiving port on the Splunk server. Then install the forwarder from the tgz link above and point it at the server.

# On the Splunk Enterprise server
sudo -u splunk /opt/splunk/bin/splunk enable listen 9997 -auth admin:'<password>'

# On the source host
sudo tar -xzf splunkforwarder-<version>-<build>-linux.tgz -C /opt
sudo /opt/splunkforwarder/bin/splunk start --accept-license
sudo /opt/splunkforwarder/bin/splunk add forward-server <splunk-server-ip>:9997
sudo /opt/splunkforwarder/bin/splunk add monitor /var/log/messages -index main
sudo /opt/splunkforwarder/bin/splunk list forward-serverCode language: PHP (php)

list forward-server should show the server under Active forwards. On the indexer, run index=main host=<source-host> in Search to confirm events are arriving. Use /var/log/syslog instead of /var/log/messages on Debian and Ubuntu. For more CLI and search commands, see the Splunk commands reference.

Common errors and fixes

SymptomLikely causeFix
./splunk: No such file or directoryRunning the command from the wrong directoryUse the full path /opt/splunk/bin/splunk, or cd /opt/splunk/bin first
Permission denied on files under /opt/splunk/varSplunk was started once as root, then as splunkStop Splunk, run sudo chown -R splunk:splunk /opt/splunk, then start it again
Prompt saying port 8000 is in useAnother service is bound to the portAccept the suggested port, or run splunk set web-port 8001 and restart
Browser times out on port 8000Host firewall or cloud security groupOpen TCP 8000 and check with ss -tlnp
Indexing paused, low disk space warningFree space is below minFreeSpaceFree up disk or move indexes to a larger volume
Forgot the admin passwordNo recovery option in the UIStop Splunk, rename etc/passwd to etc/passwd.bak, create etc/system/local/user-seed.conf with new credentials, then start

When something fails to start, look in /opt/splunk/var/log/splunk/splunkd.log first. Use tail -n 100 on it to see the most recent errors.

What was corrected in the commands above

  • The .msi link is labelled "Splunk Linux Windows file". It is the Windows installer and only runs on Windows.
  • chmod 744 on the .rpm file is unnecessary. rpm reads the package and does not need it to be executable.
  • ./splunk start only works from /opt/splunk/bin. The original runs it straight after tar or rpm without changing into that directory.
  • cd /opt/splunk before dpkg -i fails, because the directory only exists after the package is installed. Run dpkg -i from the download directory.
  • Running tar twice, with and without -C /opt, is redundant. Extract once with -C /opt.
  • enable boot-start without -user splunk makes Splunk run as root. The corrected command adds -user splunk -systemd-managed 1.

Frequently asked questions

Where does Splunk Enterprise install on Linux?

The rpm and deb packages install to /opt/splunk. The tgz archive extracts wherever you point tar -C, and /opt is the usual choice. The Universal Forwarder uses /opt/splunkforwarder.

What is the default Splunk web URL and port?

The web interface is at http://<server-ip>:8000. The management REST API uses port 8089, and forwarders usually send data to port 9997 once you enable receiving on the indexer.

Should Splunk run as root?

No. Create a dedicated splunk user, give it ownership of /opt/splunk, and enable boot-start with -user splunk so the service runs with limited privileges.

How do I start Splunk automatically after a reboot?

Stop Splunk, then run sudo /opt/splunk/bin/splunk enable boot-start -user splunk -systemd-managed 1. Splunk then runs as the Splunkd systemd service, which you control with systemctl.

What happens when the Splunk trial ends?

The Enterprise trial lasts 60 days. After that you can buy a license or switch to Splunk Free, which allows up to 500 MB of indexed data per day but has no user authentication and lacks some Enterprise features such as alerting.

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 Heavy Forwarders

A Splunk heavy forwarder is a full Splunk Enterprise installation that forwards data instead of indexing it, and it parses events before sending them on. This guide…

Read More

Splunk Command Line Reference

This page is a quick reference for the Splunk command line interface (CLI): adding and removing data inputs, sending data to an index, setting up forwarding and…

Read More

Datadog Tutorial: win32_event_log log setup using powershell

This tutorial shows how to install the Datadog Agent on Windows with PowerShell and ship Windows Event Log channels such as Application, System, Security and Setup to…

Read More

Datadog Tutorials: Tag Specifications

In a Datadog Agent log collection config, the tags field adds key:value tags to every log line the Agent collects from a source. You can then filter,…

Read More

What Error Logs Can Teach You About Website Performance

An error log is the most detailed performance report a website produces, and almost nobody reads it. Every failed request and every server crash leaves a line…

Read More

Datadog Troubleshooting Master Guide

It covers: Datadog Agent, Kubernetes Agent, Cluster Agent, integrations, logs, APM/traces, custom metrics, DogStatsD, OpenTelemetry, API keys, Terraform, monitors, SLOs, RUM, Synthetics, cloud integrations, cost, permissions, and…

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