Escolar Documentos
Profissional Documentos
Cultura Documentos
5
Search Tutorial
Generated: 8/27/2015 12:47 am
Table of Contents
Introduction..........................................................................................................1
About the Search Tutorial...........................................................................1
Part 1: Downloading and installing Splunk Enterprise....................................3
What you need for this tutorial....................................................................3
Install Splunk Enterprise on Linux, Windows, or Mac OS X........................4
Start Splunk Enterprise and launch Splunk Web........................................7
Part 2: Getting started with Splunk Enterprise...............................................11
Navigating Splunk Web.............................................................................11
Part 3: Getting data into Splunk Enterprise....................................................16
About getting data into Splunk Enterprise.................................................16
Get the tutorial data into Splunk Enterprise..............................................18
Part 4: Using Splunk Search.............................................................................22
About the Search dashboard....................................................................22
About the time range picker......................................................................25
About search actions and modes..............................................................27
About the search results tabs....................................................................30
Part 5: Searching the tutorial data...................................................................35
Start searching..........................................................................................35
Use fields to search...................................................................................37
Use the search language..........................................................................44
Use a subsearch.......................................................................................49
Use field lookups.......................................................................................52
Part 6: Saving and sharing Reports.................................................................61
About saving and sharing reports.............................................................61
More searches and reports.......................................................................66
Part 7: Creating dashboards.............................................................................76
About dashboards.....................................................................................76
Create dashboards and dashboard panels...............................................77
Add more panels to the dashboard...........................................................84
Table of Contents
Next steps...........................................................................................................89
More Splunk Search resources.................................................................89
ii
Introduction
About the Search Tutorial
Splunk Search is the primary interface for using Splunk Enterprise to run
searches, save reports, and create dashboards. This Search Tutorial is written
for the user who is new to Splunk Enterprise and the Splunk Search feature.
Make a PDF
For a PDF version of this manual, click the red Download the Search Tutorial
as PDF link below the table of contents on the left side of this page.
Note: Do not copy and paste searches directly from the PDF document into
1
System requirements
Splunk Enterprise runs on most computing platforms: Linux, UNIX, Windows, and
Mac OS. For this tutorial, you need a computer or laptop that meets the
specifications listed in the table.
Platform
RPM download for RedHat, a DEB package for Debian Linux, and a tar
file installer. For this tutorial, you can use any of these installers.
Splunk Enterprise provides two Windows installers, an MSI file and a
compressed zip file. For this tutorial, use the MSI file graphical installer.
Splunk Enterprise provides two Mac OS X installers, a DMG package
and a tar file installer. For this tutorial, use the DMG packaged graphical
installer.
Splunk licenses
Splunk licenses limit the volume of data that your Splunk installation can index
in a single day. Splunk Enterprise runs with either an Enterprise license or a Free
license. When you download Splunk Enterprise for the first time, you get an
Enterprise trial license that expires after 60 days. This trial license entitles the
server to 500 MB per day indexing volume and all of the Enterprise features. See
more about "Types of Splunk licenses" in the Admin Manual.
Next steps
The remaining topics of this section take you through installing and starting
Splunk Enterprise.
3. Double-click on splunk.pkg.
The Splunk installer opens and displays the Introduction, which lists
version and copyright information.
4. Click Continue.
The Select a Destination window opens.
5. Choose a location to install Splunk.
To install in the default directory, /Applications/splunk, click the hard
drive icon.
To select a different location, click Choose Folder.
6. Click Continue.
The preinstallation summary appears.
7. (Optional) To make changes, do one of the following actions.
Click Change Install Location to choose a new folder.
Click Back to go back a step.
8. Click Install.
Your installation begins.
8. When your install finishes, click Finish.
The installer places a shortcut on the Desktop.
Next steps
Continue to "Start Splunk Enterprise and launch Splunk Web" to start Splunk.
splunk start
# export SPLUNK_HOME=/opt/splunk
# export PATH=$SPLUNK_HOME/bin:$PATH
For information on how to access the CLI, see "About the CLI" in the Admin
Manual.
2. Type the following to start Splunk Enterprise.
$SPLUNK_HOME/bin/splunk start
$ splunk stop
$ splunk restart
$ splunk status
Splunk Web runs by default on port 8000 of the host on which it is installed. If
you use Splunk Enterprise on your local machine, the URL to access Splunk
Web is http://localhost:8000.
If you use an Enterprise license, when you launch Splunk Enterprise for the first
time, this login screen appears. Follow the message to authenticate with the
default credentials.
username: admin
password: changeme
If you are using a Free license, you do not need to authenticate to use Splunk
Enterprise. When you start Splunk Enterprise you do not see this login screen.
Instead, you go directly to Splunk Home or whatever is set as the default app for
your account.
When you sign in with your default password, you can create a password. You
can skip this step or change your password to continue.
The first page you see is Splunk Home.
Next steps
This completes Part 1 of the Search Tutorial. Continue to Part 2: Getting started
with Splunk Enterprise.
10
Apps panel
The Apps panel lists the apps that are installed on your Splunk instance that you
have permission to view. Select the app from the list to open it.
For an out-of-the-box Splunk Enterprise installation, you see one App in the
workspace: Search & Reporting. When you have more than one app, you can
drag and drop the apps within the workspace to rearrange them.
You can do two actions on this panel:
Click the gear icon to view and manage the apps that are installed in your
Splunk instance.
Click the plus icon to browse for more apps to install.
Explore Splunk Enterprise
The options in the Explore Splunk Enterprise panel help you to get started using
Splunk Enterprise. Click on the icons to open the Add Data view, browse for new
11
The Splunk bar in another view, such as the Search & Reporting app's Search
view, also includes an App menu next to the Splunk logo.
12
User menu
The User menu here is called "Administrator" because that is the default user
name for a new installation. You can change this display name by selecting Edit
account and changing the Full name. You can also edit the time zone settings,
select a default app for this account, and change the account's password. The
User menu is also where you Logout of this Splunk installation.
Messages menu
All system-level error messages are listed on the Messages menu. When there
is a new message to review, a notification appears as a count next to the
Messages menu. Click the X to remove the message.
Activity menu
The Activity menu lists shortcuts to the Jobs, Triggered alerts, and System
Activity views.
13
Click Jobs to open the search jobs manager window, where you can view
and manage currently running searches.
Click Triggered Alerts to view scheduled alerts that are triggered. This
tutorial does not discuss saving and scheduling alerts. See "About alerts"
in the Alerting Manual.
Click System Activity to see Dashboards about user activity and status of
the system.
Help
Click Help to see links to Video Tutorials, Splunk Answers, the Splunk Support
Portal, and online Documentation.
Find
Use Find to search for objects within your Splunk Enterprise instance. Find
performs matches that are not case sensitive on the ID, labels, and descriptions
in saved objects. For example, if you type "error", it returns the saved objects that
contain the term "error".
These saved objects include Reports, Dashboards, Alerts, and Data models.
The results appear in the list separated by the categories where they exist.
You can also run a search for error in the Search & Reporting app by clicking
Open error in search.
14
Next steps
Now that you are more familiar with Splunk Web, see "About getting data into
Splunk Enterprise."
15
16
17
Next steps
Now that you're more familiar with Splunk data inputs and indexes, see "Get the
tutorial data into Splunk Enterprise."
The Add Data view displays three options for adding data, lists of
common data types, and add-ons you can use to extend Splunk
Enterprise capabilities to add data.
18
4. Under Select Source, click Select File to browse for the tutorial data or Drop
the data file into the outlined box.
Because the tutorial data file is an archived data file, the next step in the
Add Data workflow changes from Set Sourcetype to Input Settings.
5. Click Next to continue to Input Settings.
Under Input Settings, you can override the default settings for Host,
Source type, and Index.
6. Modify the host settings to assign host names using a portion of the path
name.
19
8. Click Submit.
9. To confirm that the data was added successfully, click Start Searching.
The Search view opens and a search runs for the tutorial data source.
20
Next steps
Learn more about the Search app and start searching the tutorial data.
21
The App bar, which is below the Splunk bar, lets you navigate the different views
in the Search & Reporting app.
22
The Data Summary dialog box shows three tabs: Hosts, Sources, Sourcetypes.
The host of an event is the host name, IP address, or fully qualified domain
name of the network machine from which the event originated.
23
The source of an event is the file or directory path, network port, or script from
which the event originated.
The source type of an event tells you what kind of data it is, usually based on
how it is formatted. This classification lets you search for the same type of data
across multiple sources and hosts.
24
The next topics discuss each of these parts of the Search view.
Next steps
Continue reading to learn about restricting searches to a time range.
25
You can restrict the search to Preset time ranges, custom Relative time ranges,
and custom Real-time ranges or specify a Date Range or a Date & Time Range.
This tutorial uses Presets and Relative time range options.
By default, the time range for a search is set to All time. When you search large
volumes of data, results return faster when you run the search over a shorter
time period. To change the default time range for your searches, see "Select time
ranges to apply to your search" in the Search Manual.
When you troubleshoot an issue where you know the approximate range for
when the issue occurred, narrow the time range of the search to that time period.
For example, to investigate an incident that occurred yesterday, select
Yesterday or Last 24 hours. To investigate an incident that occurred 10 minutes
ago, select Last 15 minutes or Last 60 minutes. Then, adjust the time range as
needed in your investigation.
26
For example, you can specify the earliest time to read "2 Hours Ago" and latest
time to be either "now" or "Beginning of the current hour".
The timestamps adjust to show you the earliest and latest timestamps you
specify.
You can use the Date & Time Range options to specify earliest and latest times
using a calendar and timestamp.
For example, to troubleshoot an issue that took place September 30th at 8:42
PM, you can specify the earliest time to be 09/30/2014 08:40:00.000 and the
latest time to be 09/30/2014 08:45:00.000.
Next steps
Continue reading to learn about search actions and search modes.
27
This topic explains search actions and search modes that you can use to control
your search experience.
mode (the default setting) it toggles search behavior based on the type of search
you're running.
See "Set search mode to adjust your search experience" in the Search Manual.
The Share option shares the search job. This option extends the job's
lifetime to seven days and sets the read permissions to Everyone.
The Export option exports the results. Output to CSV, raw events, XML,
or JSON and specify the number of results to export.
The Print option sends the results to a printer that has been configured.
Click Close to cancel the search and return to Splunk Home.
29
Next steps
Continue to the next topic for a discussion about the format of the search results.
When you run a search, the results tabs populate depending on the the type of
search commands used in the search. If your search retrieves events, you can
view the results in the Events tab and the Patterns tab, but not in the other tabs.
If your search includes transforming commands, you can view the results in the
Statistics and Visualization tabs.
Events
The keyword search used in this screenshot retrieves events and populates the
Events results tab.
30
The Events tab displays the timeline of events, the fields sidebar, and the events
viewer. To change the event view, use the List and Format options. By default,
the events appear as a list that is ordered starting with the most recent event. In
each event, the matching search terms are highlighted.
Timeline of events: A visual representation of the number of events that occur
at each point in time. As the timeline updates with your search results, you might
notice clusters or patterns of bars. The height of each bar indicates the count of
events. Peaks or valleys in the timeline can indicate spikes in activity or server
downtime. Thus, the timeline highlights patterns of events or investigates peaks
and lows in event activity. The timeline options are located above the timeline.
You can zoom in, zoom out, and change the scale of the chart.
Fields sidebar: When you index data, Splunk Enterprise by default extracts
information from your data that is formatted as name and value pairs, called
fields. When you run a search, Splunk Enterprise lists all of the fields it discovers
in the fields sidebar next to your search results. You can select other fields to
show in your events. Also, you can hide this sidebar and maximize the results
area.
Selected fields are set to be visible in your search results. By default,
host, source, and sourcetype appear.
Interesting fields are other fields that Splunk Enterprise has extracted
from your search results.
Patterns
The Patterns tab simplifies event pattern detection. It displays a list of the most
common patterns among the set of events returned by your search. Each of
these patterns represents a number of events that all share a similar structure.
You can click on a pattern to:
View the approximate number of events in your results that fit the pattern.
See the search that returns events with this pattern.
Save the pattern search as an event type, if it qualifies.
Create an alert based on the pattern.
See "Identify event patterns with the Patterns tab" in the Search Manual.
31
Statistics
The Statistics tab populates when you run a search with transforming
commands such as stats, top, chart, and so on. The previous keyword search for
"buttercupgames" does not display any results in this tab because it does not
have any transforming commands.
Instead, the tab displays options for creating reports in Pivot, Quick Reports, and
links you to documentation about transforming Search Commands.
If you run a non-transforming search and want to make tables or charts based on
it, click Pivot to open the search in the Pivot editor. See "Open a
non-transforming search in Pivot to create tables and charts" in the Search
Manual. To learn more about Pivot, see the Data Model and Pivot Tutorial and
the Pivot Manual.
With a transforming search, such as one to find the popular categories of items
sold on the Buttercup Games online store, the Statistics tab displays a table of
results.
32
Visualizations
Transforming searches also populate the Visualization tab. The results area of
the Visualizations tab includes a chart and the statistics table used to generated
the chart.
You can change the type and Format of the visualization using the menus above
the visualization chart area. The visualization type menu displays the name of the
selected type. By default, the visualization type is the Column chart.
33
When Recommended appears next to a chart type, it indicates the types that
Splunk Enterprise suggests based on the transforming search that produced the
results.
Next steps
This section explained different views in the Search & Reporting app that you
need to know before you start searching.
34
What to search
1. Click Search in the App navigation bar.
2. In the Search landing page, look at the What to search panel.
Search assistant
You have data for an online store that sells a variety of games. Try to find out
how many errors have occurred on the site.
35
1. Open Splunk Search, and type buttercupgames into the search bar.
As you type, the Search Assistant opens. There are two parts to search
assistant: the matching search history and search help.
Search assistant suggests completions for your search based on terms it
matches in your event data. These search completions are listed under
Matching terms or Matching searches. It does not list terms or phrases that do
not exist in your event data. Search assistant also displays the number of
matches for the search term. This number gives you an idea of how many search
results Splunk will return. Here, buttercupgames appears in 36,819 events.
Here, search assistant provides Steps to help you learn How to Search. Step 1
explains searches to retrieve events with examples for searching with terms,
quoted phrases, Boolean operators, wildcards, and field values. Step 2
introduces how to use search commands.
Search assistant has more uses after you start learning the search language.
When you type in search commands, search assistant displays the command
syntax and usage.
If you do not want search assistant to open automatically, click Auto Open to
toggle it off. You can click the down arrow below the search bar to open it back
up again.
36
Next steps
See "Use fields to search" to learn how to search with fields.
About fields
When you look at the Data Summary in the search view, you see tabs for the
Hosts, Sources, and Sourcetypes that described the type of data you added to
your Splunk index.
These are also default fields (host, source, sourcetype) that Splunk Enterprise
extracts from the data during indexing. They help to specify exactly which events
you want to retrieve from the index.
What are fields?
Fields exist in machine data in many forms. Often, a field is a value (with a fixed,
delimited position on the line) or a name and value pair, where there is a single
value to each field name. A field can be multivalued, that is, it can appear more
than once in an event and has a different value for each appearance.
Some examples of fields are clientip for IP addresses accessing your Web
server, _time for the timestamp of an event, and host for domain name of a
server. One of the more common examples of multivalue fields is email address
fields. While the From field will contain only a single email address, the To and Cc
fields have one or more email addresses associated with them.
In Splunk Enterprise, fields are searchable name and value pairings that
distinguish one event from another because not all events will have the same
fields and field values. Fields let you write more tailored searches to retrieve the
specific events that you want.
See "About fields" in the Knowledge Manager Manual.
Extracted fields
Splunk extracts fields from event data at index-time and at search-time. See
"Index time versus search time" in Managing Indexers and Clusters of Indexers.
38
Default and other indexed fields are extracted for each event that is processed
when that data is indexed. Default fields include host, source, and sourcetype.
For a list of the default fields, see "Use default fields" in the Knowledge Manager
Manual.
Splunk Enterprise extracts different sets of fields, when you run a search. See
"When Splunk Enterprise extracts fields" in the Knowledge Manager Manual.
You can also use the field extractor to create custom fields dynamically on your
local Splunk instance. The field extractor lets you define any pattern for
recognizing one or more fields in your events. See "Build field extractions with
the field extractor" in the Knowledge Manager Manual.
Search for fields that use the syntax: fieldname="fieldvalue" . Field names are
case sensitive, but field values are not. You can use wildcards in field values.
Quotes are required when the field values include spaces.
This search indicates that you want to retrieve only events from your web access
logs and nothing else.
This search uses the wildcard access_* to match any Apache web access
sourcetype, which can be access_common, access_combined, or
access_combined_wcookie.
39
These are events for the Buttercup Games online store, so you might recognize
other information and keywords, such as Arcade, Simulation, productId,
categoryId, purchase, addtocart, and so on.
To the left of the events list is the Fields sidebar. As Splunk Enterprise retrieves
the events that match your search, the Fields sidebar updates with Selected
fields and Interesting fields. These are the fields that Splunk Enterprise
extracted from your data.
Selected Fields are the fields that appear in your search results. The default
40
fields host, source, and sourcetype are selected. These fields appear in all the
events.
You can hide and show the fields sidebar by clicking Hide Fields and Show
Fields.
3. Click All Fields.
In the Select Fields dialog box, you can select the fields to show in the events
list.
You see more default fields, which includes fields based on each event's
timestamp (everything beginning with date_*), punctuation (punct), and location
(index).
Other field names apply to the web access logs. For example, clientip, method,
and status. These are not default fields. They are extracted at search time.
Other extracted fields are related to the Buttercup Games online store. For
example, action, categoryId, and productId.
4. Select action, categoryId, and productId and close the Select Fields dialog
box.
The three fields appear under Selected Fields in the sidebar. The selected fields
appear under the events in your search results if they exist in that particular
event. Every event might not have the same fields.
41
The fields sidebar displays the number of values that exist for each field. These
are the values that Splunk Enterprise indentifies from the results of your search.
In this set of search results, Splunk Enterprise found five values for action, and
that the action field appears in 49.9% of your search results.
6. Close this window and look at the other two fields you selected, categoryId
(what types of products the shop sells) and productId (specific catalog number
for products).
42
Use this panel to view all the fields in a particular event and select or deselect
individual fields for an individual event.
successful requests
You can search for failed purchases in a similar manner using status!=200,
which looks for all events where the HTTP status code is not equal to 200.
sourcetype=access_* status!=200 action=purchase
This doesn't specify a source type. The search retrieves events in both the
secure and web access logs.
Example 3: Search for how many simulation games were bought yesterday.
Select the Preset time range, Yesterday, from the time range picker and run:
sourcetype=access_* status=200 action=purchase categoryId=simulation
The count of events returned are the number of simulation games purchased.
To find the number purchases for each type of product sold at the shop, run this
43
search for each unique categoryId. For the number of purchases made each day
of the previous week, run the search again for each time range.
Next steps
Fields also let you take advantage of the search language, create charts, and
build charts. Continue to "Use the search language" to learn how to use the
search language.
To find this number for the days of the previous week, you have to run it against
the data for each day of that week. To see which products are more popular than
the other, you have to run the search for each of the eight categoryId values and
compare the results.
As you type in the search bar, search assistant opens with syntax and usage
information for the search command (on the right side). If search assistant
doesn't open, click the down arrow under the left side of the search bar.
44
You've seen before that search assistant displays typeahead for keywords that
you type into the search bar. It also explains briefly how to search.
2. Type a pipe character, " | ", into the search bar.
The pipe indicates to Splunk that you're about to use a command, and that you
want to use the results of the search to the left of the pipe as the input to this
command. You can pass the results of one command into another command in a
series, or pipeline, of search commands.
You want Splunk to give you the most popular items bought at the online store.
3. Under common next commands, click top.
Splunk Enterprise appends the top command to your search string.
45
The count of events under the search bar indicates the number of events
retrieved that match the search for sourcetype=access_* status=200
action=purchase. The results of the top command appear in the Statistics tab.
46
Column, Bar, and Pie charts are recommended for this data set.
3. Select Pie.
Now, your report looks like this:
47
You can turn on drill down to delve deeper into the details of the information
presented to you in the tables and charts that result from your search.
4. Mouse over each slice of the pie to see the count and percentage values for
each categoryId.
48
Read more about drilldown actions in the Splunk Data Visualizations Manual.
Next steps
Go to the next topic to learn about correlating events with subsearches.
Use a subsearch
This topic walks you through examples of correlating events with subsearches.
A subsearch is a search with a search pipeline as an argument. Subsearches are
contained in square brackets and evaluated first. The result of the subsearch is
then used as an argument to the primary, or outer, search. Read "About
subsearches" in the Search manual.
49
Limit the top command to return only one result for the clientip. To see more
than one "top purchasing customer", change this limit value. For more
information about usage and syntax, see the "top" command's page in the
Search Reference manual.
This search returns one clientip value, which we'll use to identify our VIP
customer.
2. Use the stats command to count this VIP customer's purchases:
sourcetype=access_* status=200 action=purchase clientip=87.194.216.51 |
stats count, dc(productId) by clientip
This search used the count() function which only returns the total count of
purchases for the customer. The dc() function is used to count how many
different products he buys.
The drawback to this approach is that you have to run two searches each time
you want to build this table. The top purchaser is not likely to be the same person
at any given time range.
50
Here, the subsearch is the segment that is enclosed in square brackets, [ ]. This
search, search sourcetype=access_* status=200 action=purchase | top
limit=1 clientip | table clientip is the same as Example 1 Step 1, except
for the last piped command, | table clientip
Because the top command returns count and percent fields as well, the table
command is used to keep only the clientip value.
These results should match the previous result, if you run it on the same time
range. But, if you change the time range, you might see different results because
the top purchasing customer will be different.
51
What happens when you run the search over different time periods? What if you
wanted to find the top product sold and how many people bought it?
Next steps
In the next topic, you'll learn about adding new information to your events using
field lookups.
This opens the Lookups editor where you can create new lookups or edit existing
ones.
You can view and edit existing lookups by clicking on the links in the table for
Lookup table files, Lookup definitions, and Automatic lookups.
53
2. To save your lookup table file in the Search app, leave the Destination app as
search.
3. Under Upload a lookup file, browse for the CSV file (prices.csv) to upload.
4. Under Destination filename, name the file prices.csv.
This is the name you use to refer to the file in a lookup definition.
5. Click Save.
This uploads your lookup file to the Search app and returns to the lookup table
files list.
Note: If Splunk does not recognize or cannot upload the file, check that it was
uncompressed before you attempt to upload it again.
54
4. Click Save.
4. Click Save.
Now, prices_lookup should be shared with Global permissions.
56
6. Under Lookup input fields type in productId in both text areas under
Lookup input fields .
Splunk Enterprise matches the field in the lookup table (which is the one
specified on the left) with the field on the right (which is the field in your events).
In this case the field names match.
57
7. Under Lookup output fields, type in the name of the fields that you want to
add to your event data based on the input field matching and rename the fields.
7.1 In the first text area, type product_name, which contains the descriptive name
for each productId.
7.2. In the second text area, after the equal sign, type productName. This
renames the field to productName.
7.3. Click Add another field to add more fields after the first one.
7.4. Add the field price, which contains the price for each productId. Do not
rename this field.
58
3. Scroll through the list of Interesting Fields in the fields sidebar, and find the
price field.
4. Click price to open its field summary dialog box.
59
The result is the same as in the previous subsearch example, except that the VIP
customer's purchases are more meaningful with the added descriptive product
names.
The next section takes you through saving this search as a report called "VIP
Customer".
Next steps
As you run more searches, you want to be able to save to reuse or share them
with other people. Go to "About saving and sharing reports" to learn about saving
and sharing reports.
60
Save as a report
1. Select the time range Yesterday and run the following search. (This is the
same search you ran in the previous topic "Use field lookups").
sourcetype=access_* status=200 action=purchase [search
sourcetype=access_* status=200 action=purchase | top limit=1 clientip |
table clientip] | stats count AS "Total Purchased", dc(productId) AS
"Total Products", values(productName) AS "Product Names" by clientip |
rename clientip AS "VIP Customer"
Note: If your search does not return results, increase the time range of the
search. For example, you can run search over the time range Last week or All
Time.
2. Click Save as above the search bar and select Report.
61
62
You can open the report in the search view and edit the saved search's
description, permissions, schedule, and acceleration. You can also clone,
embed, and delete the report from this menu.
2. Click More Info.
You can view and edit different properties of the report, including its schedule,
acceleration, permissions, and embedding.
3. Look at the time range picker, located to the top left.
You saved this report with a time range picker. The time range picker lets you
change the time period to run this search. For example, you can use this time
range picker to run this search for the VIP Customer Week to date, Last 60
minutes, Last 24 hours just by selecting the Preset time range or defining a
custom time range.
63
When you save a new report, its Permissions are set to Private. This means
that only you can view and edit the report. You can allow other apps to view, or
edit, or view and edit the reports by changing its Permissions.
1. Under Actions for the VIP Customer report, click Edit and select Edit
Permissions.
64
This action gives everyone who has access to this app the permission to view it.
3. Click Save.
Back at the Reports listing page, you see that the Sharing for VIP Customer now
reads App.
65
Next steps
Continue to run more search examples and save more reports.
66
This search uses the chart command to count the number of events that are
action=purchase and action=addtocart.
2. Use the Visualization view options to format the results as a column chart.
67
viewsToPurchase=(purchases/views)*100 | eval
cartToPurchase=(purchases/addtocart)*100 | table productName views
addtocart purchases viewsToPurchase cartToPurchase | rename productName
AS "Product Name" views AS "Views", addtocart as "Adds To Cart",
purchases AS "Purchases"
Instead of the chart command, this search uses the stats command to count the
user actions. Then, it uses the eval command to define two new fields which
calculate conversion rates for "Product Views to Purchases" and "Adds to cart to
Purchases".
Steps 2 to 6 reformat the visualization to overlay the Conversion series onto the
Actions series.
2. Click Visualization.
This is the same chart as in Example 1, with two additional series,
"viewsToPurchase" and "cartToPurchase".
68
3.1 Rotate the label -45 degrees and do not truncate the label.
3.2 Click Apply.
69
6.1 In the Save Report As dialog box, enter a Title, "Comparison of Actions and
Conversion Rates by Product".
6.2 (Optional) Enter a Description, "The number of times a product is viewed,
added to cart, and purchased and the rates of purchases from these actions."
7. Click Save.
71
2. Click the Visualization tab and Format the X-Axis, Y-Axis, and Legend to
produce the following line chart.
72
3.1 In the Save Report As dialog box, enter a Title, "Product Purchases over
Time".
3.2 (Optional) Enter a Description, "The number of purchases for each product."
73
74
Next steps
Up to now, you saved searches as Reports. Continue "Creating dashboards" to
learn about dashboards and how to save searches and reports as dashboard
panels.
75
For more information about the data structures required the various
visualization types see "Data structure requirements for visualizations" in
the Data Visualization manual.
2. Click the Visualization tab and select the Pie chart type.
77
4.2. Enter the Dashboard Title, "Buttercup Games Purchases", The Dashboard
ID updates with "Buttercup_games_purchases".
4.3. (Optional) Add a Dashboard Description, "Reports on Buttercup Games
purchases data".
4.4. Type in the Panel Title, "Top Purchases by Category"
4.5. Leave the Panel Powered By as Inline search.
5. Click Save.
This creates a dashboard with one report panel. To add more report panels, you
can run new searches and save them to this dashboard, or you can add saved
reports.
79
You can Create a new dashboard and edit existing dashboards. You see the
Buttercup Games Purchases dashboard that you created.
2. Under the i column, click the arrow next to Buttercup Games Purchases to
see more information about the dashboard: What app context it is in, whether or
not it is scheduled, and its permissions.
You can use the quick links that are inline with the information to edit the
dashboard's Schedule and Permissions.
80
In this view, you have edit buttons: Add Input, Add Panel, and Edit Source.
3. Click Add Input and select Time.
4. Click the Edit Input icon for the time range picker. It looks like a pencil.
This opens a set of input controls. The Time input type should be preselected.
81
82
83
Next steps
Continue to the next topic to add more reports to your dashboard.
84
86
8. Close the Add Panel sidebar and rearrange the panels on the dashboard.
While in the dashboard editor, you can drag and drop a panel to rearrange it on
the dashboard.
9. Click Done.
Your finished dashboard should look like this:
87
Next steps
This completes the Search Tutorial.
88
Next steps
More Splunk Search resources
This tutorial was a brief introduction to navigating the search interface and using
the search language. It walked you through running some basic searches and
saving the results as a report and dashboard, but it barely cut the surface of what
you can do with Splunk Enterprise. For more details refer to the following
manuals:
Search Manual: Explains how to search and use the Splunk Search
Processing Language (SPL?). Look here for more thorough examples of
writing Splunk searches to calculate statisitics, evaluate fields, and report
on search results.
Search Reference Manual: Provides a reference for the Splunk
Enterprise user who is looking for a catalog of the search commands with
complete syntax, descriptions, and examples for usage. If you want to
start searching, check out the Search command cheat sheet. It is a quick
guide, complete with descriptions and examples.
We encourage you to investigate the tutorial data, run more searches, and create
more dashboards.
To learn more about the data model and pivot features of Splunk Enterprise, see
Data Model and Pivot Tutorial.
To learn more about Splunk Enterprise features and how to use them, see the
Splunk selection of Education videos and classes.
89