Book Image

Splunk 7 Essentials - Third Edition

By : J-P Contreras, Steven Koelpin, Erickson Delgado, Betsy Page Sigman
Book Image

Splunk 7 Essentials - Third Edition

By: J-P Contreras, Steven Koelpin, Erickson Delgado, Betsy Page Sigman

Overview of this book

Splunk is a search, reporting, and analytics software platform for machine data, which has an ever-growing market adoption rate. More organizations than ever are adopting Splunk to make informed decisions in areas such as IT operations, information security, and the Internet of Things. The first two chapters of the book will get you started with a simple Splunk installation and set up of a sample machine data generator, called Eventgen. After this, you will learn to create various reports, dashboards, and alerts. You will also explore Splunk's Pivot functionality to model data for business users. You will then have the opportunity to test-drive Splunk's powerful HTTP Event Collector. After covering the core Splunk functionality, you'll be provided with some real-world best practices for using Splunk, and information on how to build upon what you've learned in this book. Throughout the book, there will be additional comments and best practice recommendations from a member of the SplunkTrust Community, called "Tips from the Fez".
Table of Contents (10 chapters)

Controlling Splunk

There are several different ways to stop, start, or restart Splunk. The easiest way to restart Splunk is to do it from the web interface, as demonstrated in the preceding section. The web interface, however, only allows you to restart your Splunk instance. It does not offer any other control options.

The most flexible way to control Splunk is by using the CLI. Using the CLI is an essential skill for Splunk administrators.

In the console or Command Prompt, type in the following command and hit Enter on your keyboard:

Windows: C:> cd C:Splunk\bin
Linux: cd /$SPLUNK_HOME/bin

While in the $SPLUNK_HOME/bin directory, issue the following command to restart Splunk:

Windows: C:Splunk\bin>splunk restart
Linux: [user@server bin]$ ./splunk restart

After issuing this command, splunkd will go through its restart process. Here are the other basic parameters that you can pass to the Splunk application to control Splunk:

Windows:

  • splunk status: Tells you whether splunkd is running or not
  • splunk stop: Stops splunkd and all its processes
  • splunk start: Starts splunkd and all its processes
  • splunk restart: Restarts splunkd and all its processes

Linux:

  • ./splunk status: Tells you whether splunkd is running or not
  • ./splunk stop: Stops splunkd and all its processes
  • ./splunk start: Starts splunkd and all its processes
  • ./splunk restart: Restarts splunkd and all its processes

Doing this from a CLI gives the added benefit of verbose messages. A verbose message is a message with a lot of information in it. Such messages can be useful for making sure the system is working correctly or troubleshooting any errors.

A successful restart of splunkd generally has the following output (elements of which may vary):

In Windows, you can also control Splunk through the Splunkd Service, as shown in the following screenshot. The d in the service name, denoting daemon, means a background process. Note that the second service, splunkweb, is not running. Do not try to start splunkweb as it is deprecated and is there only for legacy purposes. The Splunk-running web application is now bundled in Splunkd Service: