This chapter will walk you through the most common elements in the Splunk interface, and will touch upon concepts that are covered in greater detail in later chapters. You may want to dive right into search, but an overview of the user interface elements might save you some frustration later. We will walk through:
Logging in and app selection
A detailed explanation of the search interface widgets
A quick overview of the admin interface
As of Splunk Version 4.3, no browser extensions are required. Splunk Versions 4.2 and earlier require Flash to render graphs. Flash can still be used by older browsers, or for older apps that reference Flash explicitly.
The default port for a Splunk installation is 8000. The address will look like
http://mysplunkserver.mycompany.com:8000. If you have installed Splunk on your local machine, the address can be some variant of
Once you determine the address, the first page you will see is the login screen.
The default username is admin with the password changeme. The first time you log in, you will be prompted to change the password for the admin user. It is a good idea to change this password to prevent unwanted changes to your deployment.
App is an overloaded term in Splunk. An app doesn't necessarily have a GUI at all; it is simply a collection of configurations wrapped into a directory structure that means something to Splunk. We will discuss apps in a more detailed manner in Chapter 7, Working with Apps.
Under Do more with Splunk, we find:
Add data: This links to the Add Data to Splunk page. This interface is a great start for getting local data flowing into Splunk. The new Preview data interface takes an enormous amount of complexity out of configuring dates and line breaking. We won't go through those interfaces here, but we will go through the configuration files that these wizards produce in Chapter 10, Configuring Splunk.
Find more apps: This allows you to find and install more apps from Splunkbase. Splunkbase (http://splunk-base.splunk.com/) is a very useful community-driven resource where Splunk users and Splunk employees post questions, answers, code snippets, and apps.
Manage Splunk takes the user to the Manager section of Splunk. The Manager section is used to configure most aspects of Splunk. The options provided change depending on the capabilities of the user. We will use the Manager section throughout the book as we learn about different objects.
Splunk documentation takes you to the official Splunk documentation. The documentation, hosted at splunk.com, is truly vast.
To get to documentation for search and reporting commands, quick help is provided while searching, and a link to the documentation for that command is provided through the interface.
When working directly with configuration files, the fastest route to the documentation for that file is to search for
splunk name.conf using your favorite search engine. The documentation is almost always the first link.
Splunk answers goes to the Splunkbase site we just mentioned. Splunkbase and Splunk Answers used to be different sites but were merged into one site.
The current app is specified in the upper-left corner.
Clicking on the Splunk logo or the text takes you to the default page for that app. In most apps, the text next to the logo is simply changed, but the whole block can be customized with logos and alternate text by modifying the app's CSS. We will cover this in Chapter 7, Working with Apps.
The name of the user that is currently logged in appears first. In this case, the user is Administrator. Clicking on the username takes you to the Your account page.
The App menu provides quick links to installed apps and to app administration. Only apps with GUI components that the current user has permissions to see will be listed in this menu.
The Manager link is always available at the top of the window. The availability of options on the Manager page is controlled by the role of the user.
The Jobs link pops up the Jobs window. The Jobs window provides a listing of current and past search jobs that have been run on this Splunk instance. It is useful for retrieving past results as well as determining what searches are using resources. We will discuss this interface in detail in Chapter 2, Understanding Search.
Logout ends the session and forces the user to log in again.
This form presents the global preferences that a user is allowed to change. Other settings that affect users are configured through permissions on objects and settings on roles.
Full name and Email address are stored for the administrator's convenience.
Time zone can be changed for each user. This is a new feature in Splunk 4.3.
Setting the time zone only affects the time zone used to display the data. It is very important that the date is parsed properly when events are indexed. We will discuss this in detail in Chapter 2, Understanding Search.
Restart backgrounded jobs controls whether unfinished queries should run again if Splunk is restarted.
Set password allows you to change your password. This is only relevant if Splunk is configured to use internal authentication. For instance, if the system is configured to use Windows Active Directory via LDAP (a very common configuration), users must change their password in Windows.
Download ImplementingSplunkDataGenerator.tar.gz from the code bundle available on the site http://www.packtpub.com/support.
Choose Manage apps… from the Apps menu.
Click on the button labeled Install app from file.
Click on Choose File, select the file, and then click on Upload.
The user is initially presented with the Summary view, which contains information about what data that user searches by default. This is an important distinction—in a mature Splunk installation, not all users will always search all data by default.
Let's start below the app name and discuss all the new widgets. The first widget is the navigation bar.
On most pages we encounter from now on, you will see this navigation bar. Items with downward triangles are menus. Items without a downward triangle are links. We will cover customizing the navigation bar in Chapter 7, Working with Apps.
The All indexed data panel shows statistics for all indexed data. Remember that this only reflects indexes that this particular user searches by default. There are other events that are indexed by Splunk, including events Splunk indexes about itself. We will discuss indexes in Chapter 9, Building Advanced Dashboards.
The next three panels give a breakdown of your data using three important pieces of metadata—source, sourcetype, and host.
A source in Splunk is a unique path or name. In a large installation, there may be thousands of machines submitting data, but all data at the same path across these machines counts as one source. When the data source is not a file, the value of the source can be arbitrary, for instance the name of a script or network port.
A source type
is an arbitrary categorization of events. There may be many sources across many hosts in the same source type. For instance, given the sources
/var/log/access.2012-03-02.log on the hosts
wilma, you could reference all of these logs with source type access or any other name you like.
A host is a captured hostname for an event. In majority of the cases, the host field is set to the name of the machine where the data originated. There are cases where this is not known, so the host can also be configured arbitrarily.
For our first search, we will search for the word
error. Click in the search bar, type the word
error, and then either press Enter or click on the magnifying glass on the right of the bar.
Upon initiating the search, we are taken to the search results page.
See the Using the time picker section for details on changing the time frame of your search.
Starting at the left, we have:
The number of events matched by the base search. Technically, this may not be the number of results pulled from disk, depending on your search. Also, if your query uses commands, this number may not match what is shown in the event listing.
Send to background (), which sends the currently running search to the background, where it will continue to run. Jobs sent to the background and past jobs can be restored from the Jobs window.
Pause (), which causes the current search to stop locating events but keeps the job open. This is useful if you want to inspect the current results to determine whether you want to continue a long running search.
Finalize (), which stops the execution of the current search but keeps the results generated so far. This is useful when you have found enough and want to inspect or share the results found so far.
Cancel (), which stops the execution of the current search and immediately deletes the results.
Job Inspector (), which opens the Search job inspector window, which provides very detailed information about the query that was run.
Print (), which formats the page for printing and instructs the browser to print.
Save, which provides different options for saving the search or the results. We will discuss this later in this chapter.
Create, which provides wizard-like interfaces for building different objects from this search. We will discuss these options in Chapter 4, Simple XML Dashboards.
Along with providing a quick overview of the event distribution over a period of time, the timeline is also a very useful tool for selecting sections of time. Placing the pointer over the timeline displays a pop up for the number of events in that slice of time. Clicking on the timeline selects the events for a particular slice of time.
Clicking and dragging selects a range of time.
Once you have selected a period of time, clicking on Zoom to selection changes the time frame and re-runs the search for that specific slice of time. Repeating this process is an effective way to drill down to specific events.
Deselect shows all events for the time range selected in the time picker.
Zoom out changes the timeframe to a larger timeframe around the events in the current timeframe.
Selected fields, which have their values displayed under the search event in the search results
Interesting fields, which are other fields that Splunk has picked out for you
The Edit link next to selected fields and the View all 30 fields link at the bottom of the field picker both take you to the Fields window.
Starting at the top of this section, we have the number of events displayed. When viewing all results in their raw form, this number will match the number above the timeline. This value can be changed either by making a selection on the timeline or by using other search commands.
Next, we have actions that affect these particular results. Starting at the left we have:
Events List (), which will show the raw events. This is the default view when running a simple search, as we have done so far.
Table (), which shows a table view of the results. This is the default view when any reporting commands are used. When looking at raw events, this view will show a table with the time of the event, any selected fields, and finally the raw event.
Results Chart (), which shows a chart, if the data allows. For simple searches, charts don't make sense, but they are very useful for reporting.
Export, which allows you to export these particular results to CSV, Raw events, XML, or JSON. New to Splunk 4.3 is the ability to export an unlimited number of results from the web interface.
Display row numbers toggles the display of the row number to the left of each event.
Lines per event changes the maximum number of lines of an event displayed in the browser per event. There are a few things to note here:
All lines of the event are indexed and searchable
If the value for this setting is too large, and if a search returns many large messages, your browser may have trouble rendering what it is told to display
Events with many lines will have a link at the bottom to see more lines in the event
The most interesting option here is Event segmentation. This setting changes what text is highlighted as you mouse over events. We will discuss this further in Chapter 2, Understanding Search.
The event options menu (): This menu contains workflow actions, a few of which are always available.
Build Eventtype: Event types are a way to name events that match a certain query. We will dive into event types in Chapter 6, Extending Search.
Extract Fields: This launches an interface for creating custom field extractions. We will cover field extraction in Chapter 3, Tables, Charts, and Fields.
Show Source: This pops up a window with a simulated view of the original source.
Next appear any workflow actions that have been configured. Workflow actions let you create new searches or links to other sites using data from an event. We will discuss workflow actions in Chapter 6, Extending Search.
Next comes the parsed date from this event, displayed in the time zone selected by the user. This is an important and often confusing distinction. In most installations, everything is in one time zone—the servers, the user, and the events. When one of these three things is not in the same time zone as the others, things can get confusing. We will discuss time in great detail in Chapter 2, Understanding Search.
Next, we see the raw event itself. This is what Splunk saw as an event. With no help, Splunk can do a good job finding the date and breaking lines appropriately, but as we will see later, with a little help, event parsing can be more reliable and more efficient.
Tag fieldname=valueallows you to create a tag that can be used for classification of events. We will discuss tags in Chapter 6, Extending Search.
Report on field launches a wizard showingv the values of this field over time.
Workflow actions can also appear in these field menus, allowing you to create actions that link to new searches or external sites by using a particular field value.
Now that we've looked through all of the widgets, let's use them to modify our search. First we will change our time. The default setting of All time is fine when there are few events, but when Splunk has been gathering events for weeks or months, this is less than optimal. Let's change our search time to one hour.
The search will run again, and now we only see results for the last hour. Let's try a custom time. Date is the first option.
If you know specifically when an event happened, you can drill down to whatever time range you want here. We will examine the other options in Chapter 2, Understanding Search.
The field picker is very useful for investigating and navigating data. Clicking on any field in the field picker pops open a panel with a wealth of information about that field in the results of your search.
Looking through the information, we observe:
Appears in X% of results tells you how many events contain a value for this field.
Show only events with this field will modify the query to only show events that have this field defined.
Select and show in results is a shortcut for adding a field to your selected fields.
Top values by time and Top values overall present graphs about the data in this search. This is a great way to dive into reporting and graphing. We will use this as a launching point later.
The chart below the links is actually a quick representation of the top values overall. Clicking on a value adds that value to the query. Let's click on mary.
This will rerun the search, now looking for errors that affect only the user
mary. Going back to the field picker and clicking on other fields will filter the results even more. You can also click on words in the results, or values of fields displayed underneath events.
The Manager section, in a nutshell, is an interface for managing configuration files. The number of files and options in these configuration files is truly daunting, so the web interface concentrates on the most commonly used options across the different configuration types.
Splunk is controlled exclusively by plain text configuration files. Feel free to take a look at the configuration files that are being modified as you make changes in the admin interface. You will find them in
You may notice configuration files with the same name in different locations. We will cover, in detail, the different configuration files, their purposes, and how these configurations merge together, in Chapter 10, Configuring Splunk. Don't start modifying the configurations directly until you understand what they do and how they merge.
Clicking on Manager, on the top bar, takes you to the Manager page.
Apps: This interface allows you to easily add new apps and manage apps that are currently installed. If you installed the ImplementingSplunkDataGenerator app, you have already seen this interface.
Knowledge: Each of the links under Knowledge allows you to control one of the many object types that are used at search time. The following screenshot shows an example of one object type, workflow actions.
System: The options under this section control system-wide settings.
System settings covers network settings, the default location to store indexes, outbound e-mail server settings, and how much data Splunk logs about itself
Server controls contains a single page that lets you restart Splunk from the web interface
Licensing lets you add license files or configure Splunk as a slave to a Splunk license server
Data: This section is where you manage data flow.
Data Inputs: Splunk can receive data by reading files (either in batch mode or in real time), listening to network ports, or running scripts
Forwarding and receiving: Splunk instances don't typically stand alone. Most installations consist of at least one Splunk indexer and many Splunk forwarders. Using this interface, you can configure each side of this relationship and more complicated setups (we will discuss this in a more detail in Chapter 11, Advanced Deployments ):
Indexes: An Index is essentially a datastore. Under the covers, it is simply a set of directories, created and managed by Splunk. For small installations, a single index is usually acceptable. For larger installations, using multiple indexes allows flexibility in security, retention, and performance tuning, and better use of hardware. We will discuss this further in Chapter 10, Configuring Splunk.
Deployment: The two options here relate to distributed deployments. (we will cover these options in detail in Chapter 11, Advanced Deployments):
Distributed Search: Any Splunk instance running searches can utilize itself and other Splunk instances to retrieve results. This interface allows you to configure access to other Splunk instances.
Deployment: Splunk includes a deployment server component to aid in distributing configurations to the many instances that can be involved in a distributed installation. There is no need to use the deployment server, particularly if you already have something to manage configurations.
Users and authentication: This section provides authentication controls and an account link.
Access controls: This section is for controlling how Splunk authenticates users and what users are allowed to see and do. We will discuss this further in Chapter 10, Configuring Splunk.
Your account: We saw this earlier when we clicked on the name of the user currently logged in on the top bar.
As you have seen in this chapter, the Splunk GUI provides a rich interface for working with search results. We have really only scratched the surface and will cover more elements as we use them in later chapters.
In the next chapter, we will dive into the nuts and bolts of how search works, so that you can make efficient searches to populate the cool reports we will make in Chapter 3, Tables, Charts, and Fields, and beyond.