Splunk Lab - Scheduling Reports & Alerts
Splunk Lab - Scheduling Reports & Alerts
Overview
Welcome to the Splunk Education lab environment. In these labs you will create and schedule a report,
manage the report’s settings, create scheduled and real-time alerts, define alert trigger conditions, define
actions that respond to trigger conditions and view alert settings.
Scenario
You will use data from the international video game company, Buttercup Games. A list of source types is
provided below.
NOTE: This is a lab environment driven by data generators with obvious limitations. This is not a
production environment. Screenshots approximate what you should see, not the exact output.
security Web server linux_secure action, app, dest, process, src_ip, src_port, user,
vendor_action
© 2021 Splunk Inc. All rights reserved. Scheduling Reports and Alerts 13 December 2021 1
Common Commands and Functions
These commands and statistical functions are commonly used in searches but may not have been explicitly
discussed in the module. Please use this table for quick reference. Click on the hyperlinked SPL to be taken to
the Search Manual for that command or function.
SPL Type Description Example
Sorts results in Sort the first 100 src_ip values in descending order
descending or ascending
sort command
order by a specified field.
| sort 100 -src_ip
Can limit results to a
specific number.
Returns the sum of the Calculate the sum of the bytes field
statistical values of a field. Can be
sum() function used with stats,
timechart, and chart
| stats sum(bytes)
commands.
Count all events as "events" and count all events that
Returns the number of contain a value for action as "action"
occurrences of all events
count or statistical
or a specific field. Can | stats count as events,
count() function
be used with stats, count(action) as action
timechart, and chart
commands.
Refer to the Search Reference Manual for a full list of commands and functions.
© 2021 Splunk Inc. All rights reserved. Scheduling Reports and Alerts 13 December 2021 2
Lab Exercises
Configure the lab environment user account.
Task 1: Log into Splunk and change the account name and time zone.
Set up your lab environment to fit your time zone. This also allows the
instructor to track your progress and assist you if necessary.
1. Log into your Splunk lab environment using the username and
password provided to you.
2. You may see a pop-up window welcoming you to the lab environment.
You can click Continue to Tour but this is not required. Click Skip to
dismiss the window.
3. Click on the username you logged in with (at the top of the screen) and
then choose Account Settings from the drop-down menu.
After you complete step 6,
4. In the Full name box, enter your first and last name.
you will see your name in
5. Click Save. the web interface.
6. Reload your browser to reflect the recent changes to the interface.
(This area of the web interface will be referred to as user name.)
NOTE: Sometimes there can be delays in executing an action like saving in the UI or returning results
of a search. If you are experiencing a delay, please allow the UI a few minutes to execute
your action.
© 2021 Splunk Inc. All rights reserved. Scheduling Reports and Alerts 13 December 2021 3
Scenario: Create a scheduled report for failed root logins over the last 24 hours.
3. From the Save As menu (located above the time picker), select Report.
a. Title: analyst_report_FailedRootLoginsLast24Hours
b. Time Range Picker: Yes
c. Click Save.
4. In the Your Report Has Been Created dialog box, click View.
5. Click Reports. You can see the reports to which you have access. (You can re-execute a report by clicking
the title, or view or edit the search by clicking Open in Search.) Examine the All, Yours, and This App’s
list of saved reports.
© 2021 Splunk Inc. All rights reserved. Scheduling Reports and Alerts 13 December 2021 4
d. You can View your report or exit out of the Your Report Has Been Created window by clicking
the X in the upper-right corner.
e. You can access your saved reports using the Reports tab in the application bar.
Your recently saved L1S1 report will be visible in the Reports tab.
Task 3: Schedule the failed logins report (L1S1) to run daily at 6 am.
8. If necessary, from the App drop-down menu, choose Search and Reporting to return to the Search view.
9. In the App navigation bar, click Reports.
10. For the row containing your L1S1 report, click Edit.
11. Select Edit Schedule.
12. Select Schedule Report.
13. Make the following selections:
a. Schedule: Run every day
b. At: 6:00
c. Time Range: Last 24 hours
d. Schedule Priority: Default
e. Schedule Window: 2 hours
14. Click the +Add Actions button to send an email when the scheduled report is triggered.
15. Select Send email.
16. Configure the Trigger Action as follows:
a. To: [email protected]
17. Leave all other options as default.
18. Click Save.
© 2021 Splunk Inc. All rights reserved. Scheduling Reports and Alerts 13 December 2021 5
Scenario: Create a real-time alert for multiple failed logins.
NOTE: This setting is set to 0 for testing. Once the alert is verified, you can change this value.
© 2021 Splunk Inc. All rights reserved. Scheduling Reports and Alerts 13 December 2021 6
23. Click View Alert. You should see an overview screen describing your new alert.
24. From the Splunk bar, click Activity > Triggered Alerts.
25. Select your name from the Owner menu and view the triggered alerts.
© 2021 Splunk Inc. All rights reserved. Scheduling Reports and Alerts 13 December 2021 7
26. Click the View results link on a triggered alert to see the event(s) that caused the alert.
30. From the Apps drop-down menu, select Search and Reporting to return to the Search view.
31. In the App navigation bar, click Alerts.
32. For the row containing your alert, click Edit, then select Disable.
33. When the Disable dialog box appears, click Disable
© 2021 Splunk Inc. All rights reserved. Scheduling Reports and Alerts 13 December 2021 8