Intro to Splunk
Splunk Apps
Apps are preconfigured environments that sit on top of the Splunk instance.
- workspaces built to solve a specific use case
- defined by a user with administrator role
- hundreds of apps are available on Splunk Base
- can create custom app
Roles
- 3 default roles in Splunk Enterprise:
- Admin
- can install apps
- ingest data
- create knowledge objects for all users
- Power
- can create and share knowledge objects with all users of an app
- perform real time searches
- User
- can only see their own knowledge objects and those shared with them
- Admin
- Splunk Cloud default roles:
- sc_admin
- power
- user
- cloud specific roles:
- can_delete
- token_auth
- apps
Search
- by default, a search job will remain active for 10 minutes
- shared search job will remain active for 7 days
- readable by everyone
- returned events are shown in reverse chronological order
- newest events first
- the timestamp shown in the event is based off the timezone set in your user account
Search Modes
- Fast Mode
- cuts down on field info returned
- field discovery is disabled
- Smart Mode
- default mode
- toggle behaviors based on the search
- Verbose Mode
- returns as much field and event data as possible
Search Terms
- 3 Booleans
ORANDNOT
- if no boolean, then
ANDis implied- e.g.,
term1 term2=term1 AND term2
- e.g.,
- Order of operations:
NOTORAND
- use parentheses to control order of evaluation
- use
\for character escape
What are Commands?
- Splunk’s search language is built from 5 components:
- Search terms
- the terms searched for
- Commands
- tell Splunk what to do with the search results
- e.g., creating charts, computing statistics, and formatting
- Functions
- Explain how to chart, compute, and evaluate results
- Arguments
- variables applied to the function
- Clauses
- Explain how results are grouped or defined
- Search terms
Transforming commands are commands that create statistics and visualizations.
Example
index=network sourcetype=cisco_wsa_squid usage=Violation | stats count(usage) as Visits
- Search terms:
index=network sourcetype=cisco_wsa_squid usage=Violation- Command:
stats- Function:
count- Argument:
usage- Clause:
as- Pipe
|passes the output of first result as input to command
Filtering
- Most powerful filters to use in order:
- Time
- index
- source
- host
- sourcetype
Searching Best Practices
- inclusion is generally better than exclusion
- e.g.,
access deniedis better thanNOT "access granted"
- e.g.,
- Use
ORorINoperators instead of wildcards- e.g.,
user=admin OR user=administratoruser IN (admin, administrator)- are both better than:
user=admin*
- e.g.,
- Apply filtering commands as early as possible in the search
- filtering early limits the number of events
- makes manipulation of data faster
Knowledge Objects
Knowledge objects are tools that help users discover and analyze data.
- grouped into 5 categories:
- Data interpretation
- Fields
- Field Extractions
- Calculated Fields
- Data classification
- Event Types
- Transactions
- Data enrichment
- Lookups
- Workflow Actions
- Data normalization
- Tags
- Field Aliases
- Data models
- Hierarchically structured Datasets
- Data interpretation
- uses:
- can be shared across users based on permissions
- can be saved and used by multiple users in multiple apps
- can be used in a search
- created by Knowledge Managers
- responsibilities
- oversee knowledge object creation
- implement naming conventions
- normalize event data
- create data models
- responsibilities
Creating Reports
Reports are searches that can be saved and shared.
- Save As > Report
- Title, Description, Content, Time Range Picker
- Should define a naming convention for reports
- Access reports from the Reports tab
- By default, a report is only shown for the creator
- need to give access to others:
Reports > Edit > Display For > App > select permissions
- need to give access to others:
- Can schedule a report to run at timed intervals
Reports > Edit > Edit Schedule- Can add a trigger action
Creating Dashboards
- Can save a search visualization to a dashboard
Save As > Existing Dashboard/New Dashboard
- 2 frameworks for building dashboards:
- Classic Dashboards
- Dashboard Studio
- On a Dashboard, you can add a Panel
- allows adding a new visualization from scratch without returning to search page
- or add existing visualization