
This document last updated: 07/03/08 03:07pm
This manual teaches end users about Splunk and how to use Splunk. To help you start using Splunk, run through the Tutorial.
You can share custom Splunk applications with other members of the Splunk community via SplunkBase.
Splunk is an IT search engine.
Each instance of Splunk server must have its own license. This topic discusses the different Splunk licenses, how to install or update a license, and what to do when you have a violation on your license.
Note: You must purchase a separate license for every instance of Splunk that you deploy.
Which license?Splunk provides two standard types of licenses, a Free license and an Enterprise license. To evaluate Enterprise features, you can request a trial Enterprise license before purchasing.
Note: If you evaluate a Splunk Preview release, it will include the required license.
Free versus EnterpriseWhen you download Splunk for the first time, you are asked to register. Your registration authorizes you to receive the Free license, which allows a maximum indexing volume of 500 MB/day. The Free license is not a trial license and does not have an expiration date. The Enterprise license enables higher data indexing volume and the following additional features:
To evaluate these features before you purchase an Enterprise license, you can request a 30-day trial Enterprise license.
Find more information about the different license features here. Also, read Splunk's Free license agreement.
Trial licenseYou can request trial Enterprise licenses of varying size and duration. The default evaluation period is 30 days. If you are running with a trial license and your license expires, Splunk continues to index your data. However, you will not be able to search until you install a new license.
Preview licenseSplunk's Preview releases require a different license that is not compatible with other Splunk releases. Also, if you are evaluating a Preview release of Splunk, it will not run with a Free or Enterprise license. Preview licenses typically enable Enterprise features, they are just restricted to Preview releases.
Forwarding licenseEach instance of Splunk server must have its own license. To configure Splunk for forwarding and receiving, contact Splunk Support and request a 1 MB/day license to install on each forwarder instance (any instance that is not indexing locally). For additional security, this license lets you configure different username and password pairs on each forwarder.
Note: This 1 MB/day license is not subtracted from your existing license(s) and can be applied to multiple forwarders.
Install your licenseAll Splunk servers have a license located in $SPLUNK_HOME/etc/, whether it is a Free license (splunk-free.license) or an Enterprise license (splunk.license). You can install and update your licenses with the CLI or from Splunk Web's Admin > License & Usage page.
Refer to the Installation Manual for instructions to install or update your Splunk license.
License violationsViolations occur when you exceed the maximum indexing volume allowed for your license. If you exceed your licensed daily volume on any one calendar day, you will get a violation warning. The message persists for 14 days. If you have more than 7 violations in a rolling 30-day period, search will be disabled. Search capabilities return when you have less than 7 violations in the previous 30 days or when you apply a new license with a larger volume limit.
Note: During a license violation period, Splunk does not stop indexing your data. Splunk only blocks access while you exceed your license.
If you have other issues with your license, refer to the Administration Manual for troubleshooting tips.
Splunk Web is Splunk's graphical user interface. It runs off of the splunkweb process, which is a Python-based application server. Use Splunk Web to search your IT data and manager your Splunk deployment. Access Splunk Web via a Web browser. Refer to the system requirements for our list of supported operating systems and browsers.
Splunk Web contains dashboards and configuration pages. You can run a custom search from any of the dashboards. Access the Preferences panel and the Admin pages with links on the top right corner of the dashboards, above the search bar. Access different dashboards from a drop-down menu located under the search bar and on the right.
DashboardsDashboards are customizable pages in Splunk Web. You can add and remove components to and from each dashboard. These components may be lists of all indexed data, snapshots of different saved searches, or a list of saved searches.
Splunk ships with three default dashboards: getting started, main, and admin.
Getting startedThe getting started dashboard is the default landing page for Splunk Web. It provides information and links to help new users learn how to use Splunk. There are many upcoming changes to the getting started dashboard. In 3.3, you can now watch feature videos in Splunk Web and add files and more data to your indexes, directly from the getting started dashboard.
Watch Splunk feature videos
When you first log into Splunk Web, the Learn about Splunk window displays over the getting started dashboard. This window provides demo videos of Splunk features for viewing. If you don't want to view this window next time you start Splunk, check the "Do not show this window on startup". When you're ready to begin using Splunk, click "Close this window and start using Splunk".
Note: After closing the Learn about Splunk window, you can open it again from the link under Get help on the getting started dashboard.
Index some data
In 3.3, the buttons for indexing data take you to the index manager:
Read more about the index manager and adding inputs.
MainThe main dashboard provides default modules, which include:
The admin dashboard provides graphs that report information a Splunk administrator may find useful:
Instead of editing the default dashboards, we recommend creating a new dashboard to customize. From the dashboard drop-down menu, select create new dashboard... to name your new dashboard and add it to Splunk Web. Use the Edit and Delete options, located next to the drop-down menu, to customize or remove dashboards from Splunk Web.
PreferencesUse the Preferences panel to configure Splunk Web's default search properties and general appearance and behavior. For more information, read Change Splunk Web preferences.
SearchUse the Search preferences tab to define:
Note: Splunk Web's segmentation setting has nothing to do with indexing segmentation. This setting affects how the browser interacts with Splunk and may speed up the display of search results.
GeneralUse the General preferences tab to define:
In 3.3, when you click on the Admin link, to the top right of the page, the Server settings page opens. Instead of navigating a tabbed menu layout, you now access the Admin pages from a list located on the left side of the page. Click on the top-level section names to view the pages included in that section. You have access to the same pages as before (Server, Data Inputs, Distributed, Users, Saved Searches, and License & Usage) with the addition of Indexes and Applications.
ServerUse the Admin > Server pages to view and change server settings, restart the Splunk server, and change and reload Splunk's authentication method. Read more About Splunk server's settings and changing Splunk server's settings.
Data InputsUse the Admin > Data Inputs pages to add new and edit existing inputs in Splunk Web. You can view and manage all of your files and directories, FIFO queues, network ports, and crawls from this page. Read more About Inputs and using Data Inputs to add inputs.
IndexesUse the Admin > Indexes pages to view a list of your indexes, edit individual index properties, and add new indexes. Read more About Indexes.
ApplicationsUse the Admin > Applications pages to manage existing applications and browse SplunkBase for new applications to install. Read more About Applications.
DistributedUse the Admin > Distributed pages to view your network topology and configure search distribution, data forwarding, and data receiving between multiple Splunk instances. Read more About Data Distribution.
Note: You can only set up forwarding from this page if you are running Splunk with a Free license. To configure distributed search and data receiving, you must have an Enterprise license.
UsersUse the Admin > Users page to view a list of users and their search history, edit each user's properties, and add new users. Read more about Users and User Roles.
Note: You cannot access this page if you are running Splunk with a Free license; you must have an Enterprise license to modify user's properties.
Saved SearchesUse the Admin > Saved Searches page to view a list of your saved searches and edit their properties, create new searches, or delete existing searches. Read more about Managing saved searches.
License & UsageUse the Admin > Licenses & Usage pages to view view your current license and replace it with a new one. This page displays the type of license you're running, the maximum indexing volume allowed, and when the license expires. This page also provides some useful statistics, such as: number of days before you need to renew, the peak usage in GB/day, and peak percentage. Read more About Licenses.
Change Splunk Web preferencesUse the Preferences panel to configure Splunk Web's default search properties and general appearance and behavior. The Preferences panel is a dialog box that opens when you click the Preferences link in the upper righthand corner of Splunk Web. Access the link on any of the dashboard pages.
The Preferences panel has two tabbed options: Search and General.
SearchUse the Search preferences tab to change:
To set the default time range for search, select one of the following options:
You can always change the time range at search time from the dashboard.
Change maximum search resultsThe maximum search results is the maximum limit for the number of events splunk indexes when you search. By default, it is 50000. Increasing or decreasing this number will affect Splunk's search speed.
Change segment selectionSplunk Web's segmentation setting has nothing to do with indexing segmentation. This setting affects how the browser interacts with Splunk and may speed up the display of search results.
You can set segment selection to:
Use the General preferences tab to define:
Splunk Web is defined with HTML, CSS, Javascript, and XSL. You can customize a theme with CSS files to override the default styles for font, color, and images. If you want to customize Splunk Web's appearance, refer to the Developer manual.
Change click behaviorYou can click on sections of your search results to add or replace terms in your search. "Click behavior" configures either ctrl or ctrl-click to add and replace terms when narrowing your search.
About Splunk server settingsUse the Admin > Server pages to view and change the Splunk server settings, restart the Splunk server, and change and reload Splunk's authentication method.
Important: When you change any of the server settings, you must restart Splunk for your changes to take effect.
View server settingsThe Admin > Server: View Settings page is divided into three sections. Refer to Change Splunk server default settings for instructions on changing these settings.
Basic settingsUnder the Basic Settings heading, you can change your server name and splunkd port.
Note: You cannot modify the installation path.
Splunk Web settingsUnder the Splunk Web heading, you can enable or disable Splunk Web, enable SSL (HTTPS) in Splunk Web, and change the Web port.
Under the Datastore heading, you can change the default host name, the datastore path, and the minimum free disk space.
Use the Admin > Server: Control Server page to restart the Splunk server and reload the Authentication method.
Note: Unless you are running Splunk with an Enterprise license, you will not see the Reload Authentication method option.
Configure authentication methodUse the Admin > Server: Authentication Configuration page to change Splunk's authentication method.
Note: This feature requires an Enterprise license. If you are running Splunk with a Free license, Splunk Web will tell you how to update your license.
Change Splunk server default settingsAfter you start a new installation of Splunk, you may want to change a number of the default settings. This is a quick guide for using Splunk Web to change the admin default password, your Splunk server name, the Web and splunkd network ports, the datastore location, and the minimum free disk space.
You can make all of these changes from the Admin > Users and Admin > Server: View Settings pages in Splunk Web. Refer to the User Manual for more information About Splunk Web.
Note: You can also make these changes using Splunk's CLI.
Change the passwordSplunk with a Free license does not require login authentication. However, Splunk with an Enterprise license does require authentication and ships with a default administrator account with username admin and password changeme.
To change the administrator password:
1. Navigate to the Admin > Users page in Splunk Web.
2. For the username admin, click Edit from the Action column.
The admin user properties page opens.
3. Enter your new password twice (under Password and Confirm Password).
4. Click Save.
You return to the Admin > Users page with a note at the top, "User admin updated."
The Splunk server name is the identity of that particular instance. This name is displayed within Splunk Web and is sent to other Splunk servers in a distributed setting. The default name is taken from either the DNS or IP address of the Splunk server host.
To change the Splunk server name:
1. Navigate to the Admin > Server: View Settings page in Splunk Web.
2. In the Basic Settings section, enter a new Splunk server name.
3. Click Save.
Change network portsSplunk uses two network ports that default to:
Note: Splunk Web, the command line interface, and any distributed connections from other servers use the Splunk management port to communicate with the splunkd daemon.
To change the network ports:
1. Navigate to the Admin > Server: View Settings page in Splunk Web.
2. In the Basic Settings section, enter a new Splunkd port number (under Splunkd port #).
3. In the Splunk Web section, enter a new Web port number (under Web port).
4. Click Save.
Change datastore locationThe datastore path is the top-level directory where the Splunk server stores all indexed data, user information, and working files. If you turn off local indexing and only forward data in a distributed setup, this server still requires a few megabytes of available space in the datastore path.
Important: If you change this directory, the server does not migrate old datastore files. Instead, it starts over in the new location. To migrate your data to another directory, refer to the instructions in Move an index.
To change the datastore location:
1. Navigate to the Admin > Server: View Settings page in Splunk Web.
2. In the Datastore section, enter a new Datastore path.
3. Click Save.
Change minimum free disk spaceThe minimum free disk space defines a storage space limit before Splunk stops indexing. Splunk resumes indexing when more space becomes available. For more information on managing Splunk disk usage, see Disk usage.
To change the minimum free disk space:
1. Navigate to the Admin > Server: View Settings page in Splunk Web.
2. In the Datastore section, enter a new limit under "Pause indexing if free disk space falls below".
3. Click Save.
This section briefly explains what you need to run Splunk and complete this tutorial.
RequirementsSplunk does not require a login when using a Free license. An Enterprise license requires a login:
Splunk Web runs by default on port 8000 of the host on which it is installed.
where <hostname> is the name of the machine Splunk is running on.
Logging in to Splunk takes you to the dashboard and Splunk Web. For this tutorial, you only need to know that:
Read the other sections of the Splunk User Manual for more information.
Command line interface (CLI)Splunk includes a command line interface (CLI) that runs from a shell on the server host. The Splunk CLI is a great way to integrate Splunk into admin scripts.
Read Use the Splunk CLI for more information.
Simple searchesSee a few simple searches in action.
Index dataSplunk comes with pre-indexed sample data, called sampledata, which we will use throughout this tutorial. You can search the index that has the sample data in it instead of the main index by including index=sampledata in the search criteria.
For help indexing your own data, see the data inputs section of the Admin Manual.
SearchTo start, enter your search in the search bar at the top of the page. To search for all the data in the sampledata index, type the following into the search bar:

The timeline should show bars indicating when matching results occurred. If there are no results displayed, change the time range until you see results.
Now, lets search for HTTP requests that resulted in an internal server error (code 500). Type this simple search:
You can use arguments in the search command to narrow your search. Add Boolean logic between terms and modifiers, use logical comparison operators for field values, or use search modifiers. You can also use the timeline to zoom in on particular events. This section discusses two ways to apply Boolean modifiers to your search. We'll discuss using the timeline to narrow your results later.
Read Search results for more ways to manipulate search results.
Search with BooleansSplunk supports the Boolean operators: AND, OR, and NOT (must be capitalized).
Enter the search:
Your results should match the previous example search. Similar to Google and other search engines, Splunk implicitly inserts an AND between terms by default.
Note: If your search produces no results, try zooming out, clearing the time range, or resetting the time range using the drop-down menu.
Search for all HTTP requests that do not contain error code 500:
Search for all HTTP requests that do not contain error codes 500 or 503 (service unavailable).
Note: Splunk uses parentheses to group Boolean expressions.
Click on resultsAs you scroll through your results and mouse over sections of each event, you'll notice the sections are highlighted. You can highlight and click items in the results to add and remove terms in your search string.
Search for:
Scroll through the list of results. Click on "500" in one of the search results.

Notice that Splunk highlights and updates the search to add "500" as a term (in the search bar). This is a shortcut for applying the "AND" operator to your search.
Click on another instance of "500". Splunk removes the term from your search string and your search results include all HTTP results again:
Now, alt-click on "200" in any search result (option-click for Mac, shift-click for some popular *nix windows managers).
Splunk now updates your search with "NOT 200"; This is a shortcut for applying the "NOT" operator.
While you scroll through the list of results, you may find interesting events. For example, if you want to look only at activity on one particular IP address:
Your search has been replaced with the IP address. This is an effective way to follow relationships between events.
Use the timelineThe timeline shows bars and a red line (or flag). The bars indicate the volume of search results and when they occur along the span of your time range.
You can change the time range with the drop-down menu:
You can also customize the time range by clicking on any bar in the timeline and zooming in on a particular cluster of events:

Notice that each bar is equivalent to one day of data.

Notice that each bar is equivalent to one minute of data.
Note: The red flag marks the location of the results you are currently viewing along the timeline. As you scroll through your search results, the red flag shifts to follow.

The timeline now spans several minutes, with one bar equal to one second.
Note: Your Splunk instance will perform faster if you narrow the time range of your search. Searching over all time may result in slow search performance.
Search resultsSplunk allows you to navigate search results by following links and using interactive field filters. Filtering is an efficient method to organize the results of a search.
Events and fieldsYour search results appear below the timeline as a list of events ordered by timestamp. A field is a name/value pair distinguished from the free-form indexed segments that you see in an event.

You can add and remove field filters, extract new fields from the results, and tag fields to group results.
Filter on fieldsSearch for all the sampledata index events:
Splunk includes three default filters in your search results: host, source, and sourcetype. These interactive field filters are drop-down menus located below the timeline.
Each field's filter menu lists (up to) 10 values, ordered by the frequency at which they occur in the search results.
HostThe host field, which lists the originating hosts of events, lets you target one specific host in the filter. The host field is stored and indexed with each raw event.
Click on the host menu.

From the list, select the first host value, http2. The search results filter to show only results for the selected host.
Let's look at another host value and add it to our search:
The search bar and search results update to include the host value restriction you applied, http1:
The source field lists the location where an event is accessed; a file, network port, script, etc.

The sourcetype field characterizes all sources that have similar formats. For example, all Apache access logs in W3C common format have the sourcetype value access_common. The sample data contains four distinct sourcetypes - syslog, access_common, db2 and websphere_activity.

You can include many more field filters in addition to host, source, and sourcetype, in your searches. The fields are listed in the Fields... drop-down menu.
Search for all the sampledata index events:
Let's add a couple more field filters to our search:
The interactive field filters list updates to include eventtype and punct menus. You can use these field filters exactly the same way you used host.

To remove a field filter menu:
The eventtype and punct fields are discussed further in Event types.
Define custom fieldsSplunk lets you interactively define and extract fields from your search results. Let's define a field to extract the IP addresses from our search for all events in sampledata.
You may need to scroll through the results or use the timeline to find events that contain an IP address.
Below the timestamp of every event is a drop-down menu. Click the down-arrow and select Extract field.

The Extract fields window opens.

Notice the panel at the top of this window:
To define the IP address field for extraction:

In the Rules panel:
Splunk also provides a preview of other events that contain your custom field. Use this Preview panel to validate the results of your field definition.
To save your custom field definition, click Save. The Save FIeld Definition dialog box opens.

Now, your custom field (ipaddress) is listed in the Fields menu. You can activate and apply your field filter in exactly the same way you used host.

You can tag fields to group together results that share field values. Use tagging to attach a name, or tag, to a group of results that share the same value of a field, event type, host, or source. You can apply as many tags as you want to a single field, event type, host, or source. A tag cannot contain spaces.
Note: Tags that you create for a field are displayed in italics next to that field name in your search results.
Collect snapshotsSplunk allows you to save your results in a "Snapshot Container" that houses your collection. Each snapshot includes an image of the time graph and your search string.
You can add and remove snapshots from your collection. However, after adding a snapshot, you cannot modify the time graph within the container.
If you want to modify a snapshot in your collection:
Your modified graph has been added to your snapshot collection.
Event typesSplunk allows you to classify events that have common characteristics and save them as a value in the eventtype filter field. Examples of event types include all ssd logins and all sendmail syslog messages. Editing, tagging, and naming such event types helps the Splunk server learn and improve its performance.
In this tutorial, you will search for a specific event and save your results as an event type which you can later apply to a new search.
Find similar eventsSearch for all events in the sampledata index:
Because the format of an event is often a powerful part of defining an event type, Splunk indexes the punctuation characters of events as a field called punct. This field, while it looks cryptic at first, is a powerful way of finding similar events quickly.
To activate the punct field:
The punct filter menu now appears below the timeline.
Click on this menu to view a list of the 10 punct values that are most common in your results:

Add a filter to your search for the most common punct value in sampledata, which might be:
Your results update to include only events in the sample data that have a matching punctuation scheme.
Save as event typeWe want to save the last search as an event type. First, let's add "logout" to the search string:
Now, the results are all sampledata events with the punctuation scheme that are logout actions.
To save your results as an event type:

Now you can include your new event type in a search.
Note: If your event type name contains spaces, the spaces will be replaced with underscores and the tags will not be saved. When naming the event type, do not include spaces.
Search for an event typeLet's search for all events in sampledata again.
After the search results load, activate the eventtype field filter.
From this field filter, choose trade_app_logouts.

Notice that eventtype=trade_app_logout appears as a field in your results, underneath each event:

Now, you can add the filter to your search:
You search string updates to:
Note: Identifying and saving an event type means you can search for it directly. In fact, if you know the field name and value, you do not need to activate the field filter to add it to your search.
You can also click on the down-arrow to the right of the eventtype instance to perform the following options:
You can tag event types that have very different search terms and punctuation patterns with common words, then find all events of types that have any tag. This is a great way to create higher level classifications like "logouts" that cross different logout event types from different applications.
You can also tag hosts with one or more words describing their function or type, enabling users to easily search for all activity on a group of similar servers. Tagging hosts is useful for knowledge capture and sharing and for crafting more precise searches.
See the section in our Admin manual on Host tagging.
Automated event type discoverySplunk automatically discovers event types based on seeing a large number of events sharing common characteristics. You can edit, delete, rename, and tag event types that Splunk discovers. You can also make your own event types by saving any search as an event type.
Learn how to use automated event type discovery in Splunk Web.
You can also change the settings that determine which keywords are considered in event type discovery in its eventdiscoverer.conf configuration file. Learn how to configure eventdiscoverer.conf.
Save optionsYou can save any of your searches, schedule your saved searches, and define alert conditions for your scheduled searches.
Save a searchSearch for the trade_app_logouts events in the sampledata:
To save a search:
1. Click on the search bar menu.
2. Select Save search... from the menu.
This opens the Save search dialog box.
3. In the "Search options" tab, name your search.
4. Click Save.
Note: When saving your search, you can choose to add it to one or more dashboards.
Splunk lets you delete or modify your saved searches and add them to the dashboard. For more information on how to manage saved searches, refer to the User Manual's Save, Schedule, and Alert page.
Schedule the searchFrom the search bar menu:
1. Choose Save search...
2. Click the Alert options tab.
3. Under Schedule, check "Run this search on a schedule".
Note: You can define the schedule frequency with the Basic or Cron options.
Schedule an alert After you schedule a search, you can define alert conditions based on thresholds in the number of events, sources, and hosts in your results. You can receive these alerts via RSS feed or email.You can also trigger a shell script, such as a script to generate an SNMP trap or call an API to send the event to another system. If you need additional email options (like setting the From: address) see the Alerts page in the Admin manual.
ReportsSplunk allows you to summarize the results of any search as a report in a separate window.
You can access the reports window in three ways:
We'll cover pipes and other commands in More searches.
Report on resultsSearch for all firewall deny events in sampledata.
After the results load, click Report on results >> above the timeline options. This takes you to a separate window where you can build your report.
Notice that:
Select dst from the Fields list.
Splunk updates your search string to:
The report displays:

Notice that the options in the Series panel defines the data series for your chart. You can also choose a different chart to display your results.
Let's tune this search to report only the top 10 dst values of firewall deny events and display the series in a pie graph.
In the search bar, change the limit boundary to ten and enter the search:
In the series panel, select display as "pie graph".

When you mouseover each wedge of the pie graph, an information box appears. The box lists the dst value and event count. If you click on the wedge, Splunk takes you back to the search results and updates your search string to include the specific field name and value you selected from the chart. Try it out!
Report on fieldsReturn to the search window and search for all firewall deny events in sampledata.
To report on fields:

Splunk takes you to the report window and updates your search string:
Now, you can modify your report settings.
Build new reportsFrom the reports window, you can also enter a new search and build new reports.
Search for all "access_common" data in sampledata.
From the resulting list of Fields, select bytes.
Under Series, define your data series to "show the sum of bytes vs. time split by action":

You can define a custom time range for your chart. Here, it's zoomed in to a day of data.
Note: The chart updates as you define your series.
Pick different chartsChange chart styles by selecting a type from the display as drop-down menu above the current chart.
Choose from the following chart types:
See a sample of these charts in the report gallery on our website.
Add a report to your dashboardYou can save a report just as you would any other search. When you save the search, add it to your default dashboard by checking the box at the bottom of the save dialog.
You'll see the report on the dashboard after clicking the logo to return to the home page. Dashboard searches are refreshed every tenth of the time interval (for example, a 4 hour search every 24 minutes) or every hour, whichever is shorter.
You can read more about saving searches to the dashboard in Manage saved searches.
Note: You won't see your report on your dashboard if you haven't loaded any data to your main index yet. As soon as you have data in your main index, the "getting started" links are replaced with a default dashboard including modules that are predefined in the product, plus additional searches and reports you've added.
More searchesA Splunk search consists of one or more data-generating commands and their arguments, which can include literal keywords, wildcards, Boolean expressions, modifier name and value pairs, and subsearches. The generated data (search results) can then be used as inputs into other search commands in a search pipeline.
Splunk search commands are categorized by the type of operations they perform. You've already seen some examples of data generating commands. There are also commands that allow you to:
The following examples will demonstrate some of these capabilities. Refer to Search Commands for the complete list.
ReportReport commands, such as timechart, stats, top, and rare, summarize your results in the report window.
timecharttimechart returns statistics bucketed by time and is good for driving line charts. Try these examples.
Count of deny events graphed by time.
Sum of bytes for GET requests:
Average bytes by method:
stats provides summary calculations by any field.
Total bytes sent by destination.
Let's get the top denied source IP addresses. Try it with a column graph.
rareYou can also get the 10 least common source IPs (by using rare).
TransformTransform commands, such as transaction and diff , allow you manipulate the fields and values in your search results.
transactionThis search takes events from the access logs and creates a transaction from events that share the same clientip value that occurred within 5 minutes of each other (within a 3 hour time span).
diffSearch for errors in syslog and diff the first and third results.
Compare the host field of the last search.
You can modify the order of your results based on different fields.
sortUse the sort command to re-order the top 100 src field values of netscreen deny events.
FilterYou can define constraints to modify your search results.
setReturn all URLs that have 404 errors but no 303 errors (using set).
Use the regex command to filter results out of your search results. Specify a regular expression in regex to remove results that do not match.
Note: if you want to use the "or" ("|") command in a regex argument, the whole regular expression must be surrounded by quotes (ie. regex "<expression>").
The following example gets sendmail events that contain IP addresses in the non-routable class A (10.0.0.0/8).
Note: The regex command supports inclusion of PCREs (Perl Compatible Regular Expressions).
EvaluateYou can perform operations directly on your data while searching.
fieldsUse the fields command to specify the particular fields you want to see in your results. Here we will display only the src and dst fields of the sampledata netscreen deny events.
Add a comparisonLet's go back to our top source IP addresses and filter for ones with more than 5 denies by using a logical comparison in the search command.
Use subsearchesNow we're going to put it all together by doing another search to find which of the actions with more than 2 500 http status codes also had 200 successes.
Splunk can access and process any format of IT data from different sources on your filesystem. Data sources include logfiles, FIFO queues, network ports, databases, and scripts. You can add most of these input types to your index using Splunk Web.
This topic discusses the different input types you can add to Splunk's index using Splunk Web. For information about using other methods to define inputs (such as using inputs.conf), refer to the Admin manual's data inputs page.
Files and directoriesWhen adding a new file or directory to your data inputs, you can monitor a directory, upload a local file, or index a file on the Splunk server. Use monitor to add continuous and non-destructive inputs. Upload or index files to add one-time and destructive inputs.
MonitorSplunk's monitor command is similar to the UNIX tail -f command for file monitoring. When you monitor a directory, Splunk detects subdirectories and recursively examines them for new files. As new files are added to the directory, Splunk detects the changes and updates your indexes.
When you use Splunk Web to monitor a directory, Splunk modifies your inputs.conf file in /system/local to include a stanza that defines your new input. If you monitor /var/log, Splunk adds the following stanza to your local inputs.conf:
[monitor:///var/log] disabled = false host = <hostname>
Also, you can view and edit the input properties of your monitored directory from Admin > Data Inputs: Files & Directories in Splunk Web.
UploadYou can browse for a local file and add it directly to your inputs. If you have a previous version of the file as an input, uploading a new file will overwrite the existing version. Unlike a monitored file, the uploaded file does not continuously update. Therefore, use the upload option for one-time and destructive inputs.
Uploading a local file does not modify inputs.conf. Instead, it uploads the specified file into /var/run/splunk/upload and then moves it into /var/spool/splunk for indexing. The file does not show up as a new data input in Admin > Data Inputs: Files & Directories.
Note: When you upload a local file, if necessary, Splunk unpacks and uncompresses the file before processing it.
IndexIndexing a file on the Splunk server copies the file directly into /var/spool/splunk, where it exists while Splunk processes the data. Similar to uploading a local file, this operation does not modify inputs.conf and the indexed file does not show up as a new data input in Admin > Data Inputs: Files & Directories.
FIFO queuesSplunk accesses the data in a FIFO, or named pipe, queue as though it were a file. When defining a FIFO input in Splunk Web, provide the path that directs Splunk to the queue. When choosing the FIFO data input method, consider the following:
Note: FIFOs are not recommended for application servers forwarding data to Splunk in a distributed setting. Monitor is a more reliable, stable method.
Network portsSplunk supports UDP and TCP connections. When configuring network ports, keep in mind that you cannot use ports lower than 1024 if you have not installed Splunk as root.
UDPUDP is a best effort protocol; you might not get messages if the network is clogged or has a hiccup. You also can't be absolutely sure the messages aren't spoofed or altered in transit. UDP should be reserved for logging implementations focused on day-to-day troubleshooting rather than compliance or security.
Splunk with an Enterprise license can read directly from the network on any UDP port. Use this configuration to make Splunk act directly as a syslog server by reading remote syslog events on UDP port 514. You can also send any other UDP source of logging data, including SNMP.
Like all network streaming approaches, direct UDP input is higher performance than reading files from disk.
TCPTCP is a reliable, high-performance choice for most situations, since this protocol includes checks to ensure that data has arrived safely and intact. Splunk with an Enterprise license can receive data on any TCP port, allowing Splunk to receive remote data from syslog-ng and other syslog implementations that use TCP for security or reliability. TCP is the foundation of Splunk's distributed data access.
Note: If the sending process buffers data such that events are broken into multiple pieces, Splunk may interpret the parts as multiple events. This is more likely if events are being generated intermittently, as there may be long pauses (several seconds or longer) between blocks of buffered data. If you notice truncated events, try forcing the process to send events atomically.
Use Data InputsThis topic discusses how to use Splunk Web's Admin > Data Inputs page to add new inputs and edit existing inputs. These inputs include files, directories, FIFO queues, and network ports.
For information about adding inputs using crawl and using Live Tail, refer to their respective pages.
For more information about the different inputs you can add to Splunk, read About inputs.
Access Data Inputs pageIn Splunk Web, you can add and manage all your data inputs from the Admin page:
1. On the upper righthand corner of any of the dashboards, click Admin.2. From the lefthand navigation list, click Data Inputs.
This takes you to the Admin > Data Inputs: All page which tells you how many inputs you have in each category: Files & Directories, FIFO Queue, Network Ports, and Crawls.
You can add new inputs directly from this page by clicking Add input in the "Actions" column. If you want to view and edit the actual inputs, click on the input category.
Add files and directoriesUse the Data Inputs: Files & Directories page to view and edit properties for monitored directories and uploaded files. Configure new inputs by clicking New Inputs. Change existing inputs by clicking on the input's path in the File or Directory column.
To add a new input:
1. Click New Input.
2. Under Data access, choose one of the following options:
3. Specify a pathname to the file or directory. If you choose to Upload a local file, you can browse for the source.
4. Under Host, select the host type under Set host and supply the required host value. Your host options depend on the data access method you selected in Step 2:
If you chose Monitor a directory, the Set host options include:
If you chose Upload a local file or Index a file on the Splunk server, you can only set Set host to Constant value. This requires a fully qualified domain name or IP address.
Note: Refer to the Admin manual for more information about assigning host values to an input.
5. Under Source Type, set the source type to:
6. Click Submit to save your new input.
Note: Refer to the Admin manual for more information about setting the source type for an input.
Add FIFO queuesUse the Data Inputs: FIFO Queues page to view and edit properties of each FIFO prcessed by Splunk.
Add network portsUse the Data Inputs: Network Ports page to view and edit properties for UDP or TCP ports watched by Splunk.
Run crawl searchesUse the Data Inputs: Crawls page to search for new inputs to add or update existing inputs. Refer to the Use crawl page for more information on this search feature.
Use crawlcrawl searches your filesystem for new data sources to add to your index. Configure one or more types of crawlers in crawl.conf to define the type of data sources to include in or exclude from your results. Save this crawl search and schedule it to run regularly to update your indexes.
This topic explains how to use the crawl command and how to save and schedule a crawl search. Refer to the Admin manual for instructions on configuring crawl.
Note: Splunk Preview currently supports one type of crawler, labeled file_crawler. As yet, you cannot define a custom crawler.
Run a crawlIn Splunk Web, you can access and run the crawl command from the Splunk search bar and the Admin > Data Inputs: Crawls page.
The Splunk search bar
You can run the crawl command directly from the search bar:
The Admin page
You can manage all your saved crawls from the Admin > Data Inputs: Crawls page. From this page, you can also run the default crawl search by clicking New Crawl:
For each item listed in your crawl results, Splunk displays whether or not it is a file, a timestamp indicating when it was last modified, its size, and its status (whether it is added or not added to your inputs). You can perform two actions on each data source: Add input and Preview file/directory.
Preview file or directoryTo review the contents of the data source before adding it as an input, click Preview file or Preview directory.
A new window opens:
To add the selected data source as an input, click Add input.
Now, when you go to the Admin page and select the Data Inputs tab, your selected data source is listed.
Note: Adding data inputs with crawl modifies your inputs.conf file to include a stanza describing the new source. For example, if crawl discovers /var/log, clicking Add input adds the following stanza to inputs.conf:
[monitor:///var/log] disabled = false index = main class = crawl generator = ui
After you run a crawl search, save the search by clicking the Save this Crawl... link located above your search results. This action opens the Admin > Data Inputs: Crawls: Create Crawl page which prompts you to:
Note: Your crawl won't save, if you don't provide a name.
Manage saved crawlsManage your saved crawl searches from the Admin > Data Inputs: Crawls page. You can run a new crawl or select one or more saved crawls to:
Edit the search and schedule properties of an individual crawl by clicking on its Name.
Note: You cannot change the name of your saved crawl.
Schedule saved crawlsWhen scheduling your saved crawls, you can define the type of schedule and how frequently to run it. You can also set alert options and define fields to include in summary indexes. These options are exactly the same as options provided for saving regular (non-crawl) searches.
Use Live TailLive Tail lets you monitor data that is coming into Splunk in real-time. Live Tail for Splunk Web works just like tail -f (in Linux/Unix). Search for any text in data as it is indexed into Splunk. Live Tail streams data to your browser based on a simple text search.
You can use Live Tail for a lot of different things, for example:
To start Live Tail, select the View in Live Tail menu item in the search bar drop-down menu.
Live Tail launches in a new window (or new tab - depending on your browser configuration). The Live Tail processor takes the search terms you input in the search bar(before they are piped to data processing commands), creates a search based on them, and streams data to your browser that matches the search.
The Live Tail interfaceThe Live Tail interface is a separate window opened when you click View in Live Tail in the search bar drop-down menu. The controls available to you in the Live Tail window are listed here.
Live Tail interface controls:
1. Log into Splunk. ./splunk login
2. Use the live-tail CLI command to start Live Tail.
3. Type: ./splunk live-tail "your search string", where "your search string" is whatever simple search terms you want to search for (surrounded by quotes).
The following are the current limitations of Live Tail:
We use the term "index" to refer to:
Splunk indexes data in real time. It accesses data using a variety of input methods, applies universal processing techniques to handle different formats of IT data, and persists the original raw data along with indexes and additional fields added during processing.
Note: Refer to the About inputs page for more information about input types and methods.
Events, segments, and fieldsEvents are a single record of activity or instance of data -- for example, a single log entry. Fields are attribute and value pairs that make up segments of events. As part of indexing, events are broken into segments; Splunk uses breaking characters and rules to define how events are divided.
Usually, Splunk can detect event boundaries for different data formats. However, if event boundary recognition is not working as desired, you can customize your rules in props.conf. Refer to the Admin Manual for how to configure event boundaries.
The are two types of segments: major and minor. Major segments are words, phrases, or terms in the data that are surrounded by breaking characters such as white space and newline characters. Minor segments are breaks within a major segment. For example, the IP address 192.168.1.254 may be indexed as a major segment and then separated into the following minor segment: 192, 192.168, and 192.168.1.
Edit your segment recognition rules in segmenters.conf and apply them to different fields via props.conf. Refer to the Admin Manual for how to configure segmentation.
Search and indexesSplunk stores all processed data in a collection of database directories, also called an index. Each database directory is located in $SPLUNK_DB and named db_<starttime>_<endtime>_<seq_num>. $SPLUNK_DB defaults to $SPLUNK_HOME/var/lib/splunk. The following is a list of Splunk's preconfigured indexes and a brief description of what they store:
You can create new indexes, edit index properties, remove unwanted indexes, or relocate existing indexes. You can manage (create, view, and edit) indexes from Splunk Web. For more information, refer to the User Manual's topic on managing and creating indexes. You can only remove and relocate existing indexes via the CLI. For more information, refer to the Admin Manual's topic on index management.
Unless specified, Splunk automatically searches through the default index, main. You can restrict your search to another index by specifying it in the search bar. For example, to search for HTTP requests that occurred only in sampledata:
In previous Splunk releases, you used the command line interface (CLI) to manage your indexes. Now, you can view your indexes, edit their properties, and add new indexes from the Admin page of Splunk Web.
View and manage indexesThe Admin > Index: View/Manage Indexes page displays a table of all your indexes and their properties, including:
From the Admin > Index: View/Manage Indexes page, click an index name to view and edit that index's properties. Properties that you cannot change are grayed out and include:
Properties that you can redefine include:
After you make your changes, click Update. Then, restart Splunk to apply your changes.
Note: To apply any changes that you make to the indexes, such as editing properties or adding a new index, you must restart Splunk. In Splunk Web, you can restart the Splunk server from Admin > Server: Control Server. Just click Restart Now.
Create new indexSplunk ships with an index called main that, by default, holds all your events. Splunk with an Enterprise license lets you add an unlimited number of additional indexes. One of them serves as the default index for any input and search command that don't specify and index. You can add indexes via Splunk Web, Splunk's CLI or indexes.conf.
via Splunk Web1. The Admin > Indexes: Create Index page lets you define the properties for a new index. To create a new index, enter:
2. If you check Advanced settings, the list of properties expands. Advanced properties include:
3. After setting the index's properties, click Add. Then, restart Splunk to save and apply your changes.
Note: To apply any changes that you make to the indexes, such as editing properties or adding a new index, you must restart Splunk. In Splunk Web, you can restart the Splunk server from Admin > Server: Control Server. Just click Restart Now.
You can also edit an index at any time by clicking on the index name within the Indexes tab of the Admin section of Splunk Web. Properties that you cannot change are grayed out. To change these properties, use indexes.conf.
via Splunk's CLITo use Splunk's CLI, navigate to the $SPLUNK_HOME/bin/ directory and use the ./splunk command. You can also add Splunk to your path and use the splunk command.
To add an index, first shutdown Splunk with splunk stop. Then navigate to Splunk's CLI. Then type:
# ./splunk add index [name] [directory (optional)]
Note: Do not use capital letters in your index name; this is a known problem that will be fixed.
The optional directory argument lets you set up an index outside of the default $SPLUNK_DB location.
The add index command brings you to a dialog session. Specify the configurations of your new index:
./splunk add index hatch
Hit enter to accept the default values in parenthesis, or enter your own values.
Delete an indexUse the CLI to delete an index from your Splunk instance:
# ./splunk remove index [name]
Searching is easy - type any term you'd expect to find in your data into the search box and hit Enter. A Splunk search lets you search indexed data in real-time, extract data from search results, and produce meaningful reports from the data you put into Splunk. For example, to search for all events containing a given IP address, type it into the box. Try it with usernames, error codes, transaction IDs, or whatever else you are looking for.
See the Search syntax page to learn about Splunk search syntax.
A search is pipeline of commands (similar to a Unix "|" pipeline) that starts with a command that gathers data (typically a search on data in a Splunk index), followed by data-processing commands that operate on the data to yield search results.
See the Search pipeline syntax page for details about the syntax of the search pipeline.
Generate search resultsYou can generate search results in three ways:
Use the search command to construct simple keyword searches on data in your Splunk index (just like a Google search). Narrow your keyword searches with modifiers, fields, Boolean operators, and logical comparison operators.
You can also construct more powerful searches by using additional commands to extract data, perform statistical operations, and build reports. Learn about the search commands in the search command reference.
Here are some valuable points to remember when constructing a search:
When generating dataTo get more results:
If you want a faster search:
Form searches are reusable searches that are pre-defined by a Splunk administrator. Form searches allow you to run complex searches by simply inputting variables in form fields. Learn more about Form searches.
Macro searchesMacro searches allow macro substitution of variables in saved searches. This allows you to run a complex search repeatedly with different variables. Learn more about Macro searches.
Transaction searchesTransaction searches let you search for groups of related events that are pre-defined as a transaction by your Splunk administrator. Use the transaction command to execute a transaction search. You can override specifications of a pre-defined transaction, or define a new transaction with the transaction command. Learn more about Transaction search.
Live TailLive Tail allows you to see data as its being indexed into Splunk in real-time (similar to Unix's tail -f command). Live Tail allows you to execute a simple search in its stand-alone window, and monitor events that match the search. Find out more about Live Tail.
Asynchronous searchesThe Splunk CLI allows you to run multiple searches asynchronously. Use this if you have a search or report you want to run on a large amount of data where the search could take days and you still want to be able to run other searches with Splunk. Use the dispatch CLI command to execute asynchronous searches. Learn more about asynchronous searches.
CLI searches Schedule and save searches Tune search performanceSplunk's searches are optimized for text-based searching of raw event data. Search speed is dependent on how your Splunk install is configured. You can improve the speed of your searches by editing configuration files, and by downloading various add-ons from SplunkBase. Read more about tuning search performance.
Form searchA form search is a saved search that has form fields that you must fill in before you run a search. Save any complicated search, and make it reusable as a form search (learn how to create form searches).
Form searches are saved searches that appear as forms when run. Save any search with form fields that a user running the search must fill out with parameters to run the search. You can create a sophisticated saved search and save it as a form with as many form fields as you like.
For example, you can define a search that returns all Web server errors for any username to be specified at search time:
When run, this search appears as a form labeled user.

The search 503 OR 500 OR 404 sourcetype=access_common is still part of the search, but does not appear to the user.
Note: Form search works via text substitution, so the form fields can consist of anything, not just an indexed or an extracted field.
Run a form searchForm searches are saved searches. Run a form search by selecting it from the "Saved searches" menu in the search bar drop-down in Splunk Web.
If the saved search you select is a form search, then you'll be prompted with a form dialog like this:

Fill out the values in the form.
Note: You can substitute any text (not just a field) in a free-form text box in the form.
Refer to the Admin guide section on form searches to learn how to create form searches.
Transaction searchTransaction search enables you to search, and report on transactions in Splunk. A transaction is a grouping of events that contain related pieces of information. Transaction search is useful for a single observation of any physical event stretching over multiple logged events.
Here is an example of what can make up a transaction:
In this case, the Web access log might share a session ID with the event in the application server log; the application server log might contain the account ID, transaction ID, and product ID; the transaction ID may live in the message queue with a message ID, and the fulfillment application may log the message ID along with the shipping status. All of this data represents a single user transaction.
Useful transactionsThere are many cases where a transaction search may be useful. Here are some use cases for transaction search:
Search for transactions using the transaction search command. transaction yields groupings of events which may then be used in reports. To use transaction, either call a pre-configured transaction type (that your Splunk Administrator configured), or define transaction constraints in your search by setting the specification options of transaction.
Example transaction searchesRun a search that groups together all of the pages a single user (or client IP address) looked at over a time range.
This search takes events from the access logs, and creates a transaction from events that share the same clientip value that occurred within 5 minutes of each other (within a 3 hour time span).
Transactions and macro search are a powerful combination that allow substitution into your transaction searches. Make a transaction search and then save it with $field$ to allow substitution.
When to not use transactionsIt is almost always more efficient to use the stats command when computing aggregate statistics over transactions parameterized by a unique identifier. For example, to compute the statistics of the duration of a transaction parameterized by the field trade_id:
* | stats min(_time) as earliest max(_time) as latest by trade_id | eval duration = latest-earliest | stats min(duration) max(duration) avg(duration) median(duration) perc95(duration)Similarly, if you want to compute the number of hits per clientip in an access log:
You can also compute the number of distinct sessions (parameterized by cookie) per clientip in an access log:
Save searches with macro fields, which are values you set at search time. You can create sophisticated saved searches with as many macro fields as you like. Use macro searches in Splunk Web or in Splunk's CLI. Macro searches work similarly to form searches, except there is no graphical user interface.
Configure a macro search1. Create a saved search. Use $TERM$ to specify a macro field for substitution. You can specify any number of macro fields.
2. Save the search and name it. The fo