SlideShare a Scribd company logo
Advanced Dashboards & Visualizations
Listen to your data™ 1
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Advanced Dashboards & Visualizations
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 2
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Document Usage Guidelines
•Should be used only by enrolled students
•Not meant to be a self-paced document, an instructor is needed
•Do not distribute
6 November 2015
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 3
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Course Prerequisites
Classes • Splunk Tutorial (eLearning)
• Using Splunk (ILT or eLearning)
• Searching and Reporting with Splunk (ILT)
• Creating Splunk Knowledge Objects (ILT)
Skills • Working knowledge of HTML
• Some XMLand JavaScript experience (recommended)
In order to receive credit for this course,
you must complete all lab exercises.
Important
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 4
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Course Goals
Upon completion of this course you will be able to:
•Use best practices for planning and creating views
•Define data structure requirements for visualizations
•Create efficient, well-formed searches that generate charts
•Edit simple xml to enable:
– dynamic drilldowns
– global searches
– tokens
•Use JavaScript and CSS to create interactive visualizations
•Troubleshoot views
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 5
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Course Outline
Module 1: Introduction to Views
Module 2:Adding Content
Module 3: Using Simple XML
Module 4: Creating Forms
Module 5: Customizing Dashboards
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 6
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Course Scenario
•As in the other Splunk courses, the use
cases in this course are based on
Buttercup Games, a gaming company
•The views are based on business analytics
from web access logs and lookups
Data Host	
   Sourcetype	
  
Online transactions
& web server
www1 access_combined
linux_secure	
  
www2
www3
Retail sales data vendorUS1 vendor_sales	
  
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 7
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Callouts
Scenarios
•Many of the examples in this course
relate to a specific scenario
•For each example, a question is
posed from a colleague or manager
at Buttercup Games
Notes & Tips
•References for more information on
a topic and tips for best practices
How can we use an view to limit
types of searches?
Scenario ?
Functions and arguments used with
stats and chart can also be used
with timechart.
Note
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 8
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Module 1:
Introduction to Views
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 9
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Module Objectives
Upon successful completion of this module, you will be able to:
•Define what is a view
•Identify best practices for creating views
•Define the common information model
•Normalize data to CIM
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 10
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
What is a view?
•Every page in Splunk Web is a view
– Dashboards
– Forms
•Each view is a web page built from:
– XMLfile that defines the content
– HTMLfile that defines the layout
– CSS and JavaScript files that define
the appearance and interactions
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 11
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Dashboards
•Most common type of view
•Collection of data visualizations
that tell a meaningful story
•Display results as event list or in
graphical form: charts, graphs,
tables, etc.
•Typically, limited user input
•Default interactive features
– Mouse over values, core drill-down
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 12
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Forms
•An interface that allows
users to enter values for
one or more search terms
from a variety of inputs
•Shield users from the details
of the underlying search
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 13
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Dashboards & Forms
•Similarities
– Layout of rows, panels,
and panel visualizations
•Differences
– Top-level element:
<dashboard> and <form>
– Forms have user inputs:
time range picker, drop-down lists,
radio buttons, text box, etc.
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 14
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Stakeholders
•Depending on the complexities of your
dashboard, your stakeholders may include:
– SplunkAdministrator
– JavaScript developer
– Security expert
– Business user
– UX designer
•Questions to ask:
– How will users access your dashboards?
– Will the dashboards use JavaScript?
– Should the views be deployed with their own app?
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 15
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Best Practice
• Plan: Identify key metrics, time frames,
visualizations; then, wireframe the view
• Add content: Create basic searches,
views, and visualizations
• Add interactivity: Add buttons, inputs,
tokens, and dynamic drilldowns
• Get stakeholder sign-off
• Refine: Optimize searches, add tokens, use
post-processes, create macros and data models
• Customize: Add custom features available
with CSS and JavaScript
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 16
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Plan
•An iterative process between you and
the stakeholders
– What critical metrics do users want?
– What is the time span for the data?
– What is the timeframe for refreshing data?
– What visualizations will be required?
– What should the layout look like?
•Wireframing is the process of designing
a view through prototyping
Use sketches then build
Or add a static version as an interim step
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 17
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Managing Views
Views are scoped to your app context and permissions can be applied to it
1
2
4
3
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 18
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Troubleshooting Views
•Examine the panel's search
– Check for syntax errors
– Run it manually in the relevant app context
•View all previous searches with their stats
– Run | history
•Examine the view's source
– Appending "?showsource=1"
– Use "&showsource=1" if other parameters
have already been appended
– Expand macros and event types
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 19
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Troubleshooting Views – Job Inspector
Examine impact of
knowledge object
processing, such as
event types, tags,
lookups and so on
Click inspect to open
the job inspector
For more information on the Job Inspector,
see the Knowledge Manager Manual.
Note
1
2
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 20
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Troubleshooting Views – Job Inspector (cont.)
Debug messages
You won't see these messages
until the search has completed.
Note
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 21
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Common Information Model
•Methodology to normalize data
•Match a common standard, using the same field names and event tags
for equivalent events from different sources or vendors
Normalized
Field Names
Data Source 2
Data Source 1
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 22
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Splunk CIM Add-on
•Set of 22 pre-configured data models
– Fields and event category tags
– Least common denominator
of a domain of interest
•Leverage the CIM so that knowledge
objects in multiple apps can co-exist
on a single Splunk deployment
The data models included in the CIM add-on are
configured with data model acceleration turned off.
Note
Splunk CIM Add-On Data Models
Alerts Java Virtual Machines (JVM)
Application State Malware
Authentication Network Resolution (DNS)
Certificates Network Sessions
Change Analysis Network Traffic
CIM Validation (S.o.S) Performance
Databases Splunk Audit Logs
Email Ticket Management
Interprocess Messaging Updates
Intrusion Detection Vulnerabilities
Inventory Web
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 23
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Get Data In
1
Using the CIM
Examine Your Data Create Event
Types & Tags
Create Field Aliases
2 3 4 6
Validate Against Model
✓
✓
✓
Best Practice
Add Missing
Fields & Tags
5
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 24
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Using the CIM (cont.)
•Examine Your Data
– Go to Settings > Data Models
– Identify a data model relevant
to your dataset
Object Hierarchy
Data Types
Tags and Other Constraints
Inherited
Fields
Extracted
Fields
2
Keep the CIM Reference Tables in Splunk
Docs page open in a separate tab.
Best Practice Calculated
Fields
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 25
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Using the CIM (cont.)
•Create Event Types & Tags
– Identify the CIM objects relevant
to your events
– Observe which tags are required
for that object or any parent objects
– Apply those tags to your events
using event types
3
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 26
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Using the CIM (cont.)
•Create FieldAliases
– Determine whether any existing
fields in your data have different
names than the names expected
by the data models
– Define field aliases to capture the
differently named field in your original
data and map it to the field name that
the CIM expects
4
Field name
in CIM object
Field name
in your data
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 27
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Using the CIM (cont.)
•Add Missing Fields
– Create field extractions
– Write lookups to add fields
and normalize field values
•ValidateAgainst Data Model
– Using datamodel command
OR
– Using Pivot in Splunk Web
5
6
For more information, see the
Common Information Model Add-on Manual.
Note
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 28
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
datamodel	
  Command
•Search against a specified data
model object
•Return a description of all or a specified
data model and its objects
•Is a generating command and should
be the first command in the pipeline	
  	
  
	
  
	
  	
  	
  	
  	
  	
  
The object name and search keyword aren't valid unless
preceded by the data model name. The keyword search
cannot be substituted with a search string or name.
Important
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 29
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
datamodel	
  Command – Example
A
|	
  datamodel	
  Web	
  Web	
  search	
  |	
  fields	
  Web*	
  
A B C
command
data model name
data model object name
keyword
find field names with Web prefix
B
C
D
D
When using the datamodel command, the data
model name and object name are case-sensitive
Note
Object name
prepended to field
names in your data
E
E
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 30
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Lab 1 – Get to Know Your Data
Time: 20 – 25 minutes
Tasks:
– Log into Splunk Web
– Change the account name and time zone
– Examine the use case and wireframe
– Make your data CIM-compliant
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 31
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Module 2:
Adding Content
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 32
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Module Objectives
Upon successful completion of this module, you will be able to:
•Define data structure requirements
•Identify the primary transforming commands
•Split values into multiple series
•Chart multiple values on the same timeline
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 33
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Create Basic Searches
•Basic, hard coded searches
– Add tokens, macros,
data models later
•Use naming conventions
– At least the same prefix
–Group, search type, view type,
platform, category, time interval,
description, and project
Command Description
bucket Puts continuous numerical values into discrete sets.
chart Returns results in a tabular output for charting.
dedup Removes subsequent results that match a specified criteria.
eval Calculates an expression and puts the value into a field.
fields Adds or removes fields from search results.
lookup Explicitly invokes field value lookups.
multikv Extracts field-values from table-formatted events.
rangemap Sets RANGE field to the name of the ranges that match.
rex
Specify a Perl regular expression named groups to extract
fields while you search.
spath Extracts key-value pairs from XML or JSON formats.
stats Provides statistics, grouped optionally by fields.
timechart Create a time series chart and corresponding table of statistics.
transaction Groups search results into transactions.
where Performs arbitrary filtering on your data.
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 34
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Data Structure Requirements
•Search not generating any statistical values, or the visualization you want
not available?
•Modify the search to get the visualization you want
Data series: a sequence of related
data points that are plotted in a chart.
Note
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 35
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Data Structure Requirements – Single Series
•Search results structured as tables
with at least two columns
– First column provides x-axis values
– Second column provides y-axis
values for the chart
sourcetype=vendor_sales	
  	
  
|	
  chart	
  avg(price)	
  over	
  Vendor	
  
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 36
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Data Structure Requirements – Multi-Series
•Search results structured as tables
with three or more columns
– First column provides x-axis values
– Subsequent columns provide y-axis
values for each series in the chart
– Underlying search must use
transforming commands like
stats, chart, or timechart
sourcetype=vendor_sales	
  VendorID<4000	
  
|	
  chart	
  count	
  over	
  VendorCountry	
  	
  
	
  	
  by	
  product_name	
  limit=5	
  useother=f	
  
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 37
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Data Structure Requirements – Time Series
•Time series display statistical trends over time
– Any search using the timechart command
– First column provides _time values
– Subsequent columns provide y-axis values for each series in the chart
• Underlying search must use transforming commands like stats, chart, or timechart
sourcetype=access_combined	
  action=purchase	
  status=200	
  
|	
  timechart	
  count(action)	
  by	
  host	
  
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 38
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Data Structure Requirement Summary
Built-in Visualization Series Dimensions Table Columns
Column, line,
and area charts
single, multiple 2 Two column minimum:
first = x-axis, second = y-axis, additional = y-axis
Bar charts single, multiple 2 Two column minimum:
first = y-axis, second = x-axis, additional = x-axis
Pie charts single 1 Two column:
first = slice label, second = label value, additional = ignored
Bubble charts single, multiple 4 Three column:
first = series label, second = x-axis, third = y-axis (numerical for best results),
additional = ignored
Scatter charts single, multiple 3 Two or three columns:
single series (two column): first = x-axis, second = y-axis,
multiple series (three column): first = series names, second = x-axis, third: y-axis
Single value – 1 One column
Gauges single 1 Two column:
first = range value, second = x-axis, additional = ignored
Map single 2 Two column:
first = slice label, second = label value, third = longitude, fourth = latitude
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 39
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Transforming Commands
•Required to transform search results into visualizations
•The primary transforming commands are:
– chart: displays any series of data that you want to plot
– timechart: displays trend over time; display _time on the x-axis
– stats, eventstats, geostats, geom, and streamstats: display summary statistics
– top: displays the most common values of a field
– rare: displays the least common values of a field
– associate, correlate, and diff: display associations, correlations,
and differences between fields in your data
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 40
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Statistical Functions
•These five transforming commands
work with statistical functions:
– chart, timechart, stats, eventstats,
streamstats
•Available statistical functions:
– count, distinct count
– mean, median, mode
– min, max, range, percentiles
– standard deviation, variance
– sum
– first occurrence, last occurrence
sourcetype=access_combined	
  action=purchase	
  	
  
|	
  timechart	
  span=1h	
  
	
  	
  min(price)	
  as	
  min,	
  	
  
	
  	
  max(price)	
  as	
  max,	
  	
  
	
  	
  mean(price)	
  as	
  mean,	
  	
  
	
  	
  median(price)	
  as	
  median,	
  	
  
	
  	
  stdev(price)	
  as	
  "standard	
  dev",	
  	
  
	
  	
  range(price)	
  as	
  range	
  
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 41
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Characteristic Visualization
Temporal Data Stacked Line and Area Charts
Y-Axis is Numerical Line, Area, Column Charts
X-Axis is Numerical Bar Chart
Constituent Totals Stacked Bar, Column Charts
Percentage Pie Chart
Discrete Events Scatterplot
Discrete Events with X, Y, Z axis Bubble Chart
Lots of measures at once,
High-level
Single Value
Gauge
Compare Locations Map
Splunk Visualizations
Charts
Single Value
Maps
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 42
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Which Visualization Should I Use?
Do I have at
least 3 or 4
dimensions
of data?
Yes: use a scatterplot or bubble chart
No, two dimensions: use a line or
area chart
No, one dimension: use a bar chart,
column chart, line chart or area chart
Do I need
to show
something
changing
in time?
Yes: use the timechart command
to plot a line, column, area, or a
stacked area chart
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 43
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
xyseries Command
•xyseries	
  <x-­‐field>	
  <y-­‐name-­‐field>	
  <y-­‐data-­‐field>	
  	
  
•<x-­‐field> is the field to use as the x-axis
•<y-­‐name-­‐field> is the field that contains
the values to be used as labels for the
data series
•<y-­‐data-­‐field> is the field(s) that
contains the data to be charted
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 44
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
xyseries Command – Example
Evaluate online sales for the previous month.
Scenario ?
A B
C
sourcetype=access_combined	
  action=purchase	
  	
  
|	
  stats	
  count	
  by	
  product_name	
  categoryId	
  	
  
|	
  where	
  count	
  >	
  20	
  
|	
  xyseries	
  	
  	
  product_name	
  	
  	
  categoryId	
  	
  	
  count	
  	
  
|	
  fillnull	
  value=-­‐	
  
A B C
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 45
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
xyseries vs. stats	
  
•Generally, instead of xyseries, you would use chart	
  a	
  over	
  b	
  by	
  c	
  
chart	
  a	
  over	
  b	
  by	
  c	
  is equivalent to:
stats	
  a	
  by	
  b,c	
  |	
  xyseries	
  b	
  c	
  a	
  
•However, if you need to do some processing after the chart command,
use stats followed by xyseries	
  
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 46
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
chart vs. xyseries – Examples
sourcetype=vendor_sales	
  	
  
|	
  chart	
  count(price)	
  as	
  count	
  over	
  	
  
	
  	
  product_name	
  by	
  categoryId	
  
|	
  fillnull	
  value=0	
  
sourcetype=vendor_sales	
  	
  
|	
  chart	
  count(price)	
  as	
  count	
  over	
  	
  
	
  	
  product_name	
  by	
  categoryId	
  
|	
  where	
  count	
  >	
  100	
  
sourcetype=vendor_sales	
  	
  
|	
  stats	
  count(price)	
  as	
  count	
  by	
  	
  
	
  	
  product_name,	
  categoryId	
  	
  
|	
  where	
  count	
  >	
  100	
  	
  
|	
  xyseries	
  product_name,	
  categoryId,	
  count	
  	
  
|	
  fillnull	
  value=0	
  
A
B
C
Display the number of retail sales the previous week
that exceeded 100, by product name and category.
Scenario ? A
B
C
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 47
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Improving Performance
•Refine Searches
•Create Reports
•Schedule Reports
•Accelerate Reports
•Use Summary Indexes
•Accelerate Data Models
•Use tstats Command
•Use Tokens
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 48
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Schedule Reports
•Schedule a new report when you save
a search or pivot
•Schedule an existing report:
– Navigate to the Reports page, and locate the report
– In theActions column, click Edit > Edit Schedule
– Select a Schedule type
▸Basic: choose from a range of preset options
▸Cron: set up a schedule using standard cron
– Select a Schedule Window (optional)
Note:Thisisforwhentherearemanyconcurrently
scheduledreports.
1
2
3
4
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 49
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Refine Searches
•Use the most efficient
command for the use case
– tstats
– stats vs. transaction
•Make the base search
as specific as possible
...	
  |	
  transaction	
  trade_id	
  |	
  chart	
  count	
  by	
  duration	
  	
  
...	
  |	
  stats	
  range(_time)	
  as	
  duration	
  by	
  trade_id	
  	
  
|	
  chart	
  count	
  by	
  duration	
  	
  
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 50
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Refine Searches (cont.)
•Restrict your search to the specific host, index, source, source type,
or Splunk server
•Limit your search to a specific time window
•Limit the quantity of data retrieved
– For example, use the head command: sourcetype=access_* | head 1000.
•Avoid using NOT expressions when possible
– Instead of using (NOThost=d NOThost=e) or (host!=d OR host!=e),
use (host=a OR host=b OR host=c)
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 51
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Search Acceleration
Report
Acceleration
• Accelerates individual reports
• Uses automatically-created summaries to speed completion times for qualified reports
• Easier to create than summary indexes and backfill automatically
• Depending on the defined time span, periodically ages out data
• Can correct gaps and overlaps from the UI 'rebuild' feature
• Cannot create a data cube and report on smaller subsets
Summary
Indexing
• Accelerates reports that don't qualify for report acceleration
• Uses manually created summary indexes that exist separate from main indexes
• Useful for searches that don't qualify for report acceleration
• Can persist after events have been frozen by controlling retention period or index size
• Backfill is a manual (scripted) process
Data Model
Acceleration
• Accelerates all of the fields defined in a data model
• Uses automatically-created summaries to speed completion times for pivots
• Takes the form of time-series index files
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 52
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Report Acceleration
• You
– Your role has the schedule search capability
– You have write permissions for the report you want to accelerate
• The report
– Was not created via Pivot
– The underlying search qualifies for acceleration:
▸usesatransformingcommand(suchaschart,timechart,stats,andtop)
▸onlystreamingcommandsbeforethetransformingcommand
▸basesearchdoesnotuseeventsampling
• Search Mode
– If the underlying search uses verbose mode, it is automagically changed to smart or fast
– You cannot change search mode of an accelerated report to verbose
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 53
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
When Splunk Does NOTAccelerate Reports
•Splunk generally won't generate a summary if:
– There are fewer than 100K events in the summary range –
It’s faster executing the search without a summary
– Summary size is projected to be too large –
It’s faster executing the search because the main index is smaller
•If a summary is defined and not created for the above reasons, Splunk
continues to check periodically, then automatically creates a summary
after it meets the requirements
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 54
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Summary Indexing
•Efficiently report on large volumes of data
– When a search is run results are saved to a summary index
– Then you can run searches against this smaller, and thus faster, summary index
– Allows the cost of a computationally expensive report to be spread over time
•Amortize costs of reports, over different but overlapping time range
– Summary data generated on aTuesday can be used for a report of the previous
7 days done on the Wednesday,Thursday, or the following Monday.
Summary indexing volume is not counted against your
license, even if you have multiple summary indexes.
Note
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 55
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Accelerate Data Models
•Use to speed up data models that represent extremely large datasets
•Speeds up reporting for the entire set of attributes (fields)
– Report acceleration and summary indexing speed up
individual searches on a report by report basis
•Set of .tsidx file summaries is created and scheduled searches
are run every five minutes to keep current
•Affects only event object hierarchies
•Most efficient if the root event objects include the index(es) in their
initial constraint search
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 56
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
tstats Command
•Perform statistical queries on
indexed fields in tsidx files
– Normal index data
– tscollect data
– Accelerated Data Models
•Query the tsidx files of a specific
accelerated data model in Search
•Verify a data model is capturing
the data you expect
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 57
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
tstats Command – Example
•Agenerating processor, so it must be the first command in a search pipeline
•Use prestats to pipe results to chart or timechart for creating visualizations
...|	
  tstats	
  prestats=t	
  count	
  by	
  _time	
  span=1d	
  	
  
	
  	
  	
  |	
  timechart	
  span=1d	
  count	
  	
  
Gives a timechart of all the data in your
default indexes with a day granularity.
Scenario ?
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 58
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Lab 2 – Create a Prototype
Time: 25 – 30 minutes
Questions:
– Answer a set of questions concerning types
of searches.
Tasks:
– Create a dashboard with basic searches
– Schedule and accelerate reports
Challenge Task:
– Create a data model
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 59
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Module 3:
Using Simple XML
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 60
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Module Objectives
Upon successful completion of this module, you will be able to:
•Define the simple XMLsyntax
•Name three types of dashboard panels
•Identify six simple XMLpanel objects
•Create a dashboard with panels that use post process searches
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 61
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Simple XML
•Create and modify dashboards without
writing any simple XMLcode
– Dashboard editor
– Form editor
– Visualization editor
•Can also code simple XML
– Custom charts, gauges, and rangemaps
– Dynamic drilldown behaviors
– Tokenization
– Post-process searches
…and much more
Visualization
Editor
Dashboard & Form Editor
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 62
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Simple XML (cont.)
•There are many ways to customize
views by editing the simple XML
– Layout
– Tokenization
– CSS styles
– Custom scripts
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 63
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Simple XML Syntax
Label
Root Element
<dashboard>	
  
<label>Your	
  Dashboard	
  Title</label>	
  
...	
  
</dashboard>	
  
Chart Title
Panel Title
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 64
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Simple XML Syntax (cont.)
inline search
chart
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 65
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
CDATATags
•Special characters in XML files
– Some characters have special
meaning in an XMLfile and cannot
be used literally.
– Wrap the text with special
characters within CDATAtags.
– Or escape special characters
using HTMLentities.
Character	
   HTML	
  En/ty	
  
' &apos;
< &lt;
> &gt;
& &amp;
<link>
<![CDATA[
/app/search/form_for_drilldown?
form.sourcetype=$row.sourcetype$&earliest=
$earliest$&latest=$latest$
]]>
</link>
The search in this dynamic
drilldown has an ampersand
CDATA Tags
<![CDATA[	
  "Text	
  within	
  tags"	
  ]]>	
  
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 66
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Panels
Each panel has six possible visualization elements:
Panel Description Create or Edit Using
1. Chart Displays search results as a chart Visualization editor or XML editor
2. Event List Displays search results as individual events Visualization editor or XML editor
3. HTML Displays inline HTML XML editor only
4. Map Displays search results as map Visualization editor or XML editor
5. Single value Displays a single value visualization
and various styles of gauges
Visualization editor or XML editor
6. Table Displays search results as a table Visualization editor or XML editor
In Splunk 6 and prior, panel type referred to
a visualization. In with Splunk 6.1 and later
a panel is a container for a visualization.
Note
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 67
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Panel Categories
•Inline: displays content of a search string or post-process
•Report: displays contents of a report
•Prebuilt: displays contents of a preexisting panel
Inline Panel Report Panel
Prebuilt Panel
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 68
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Creating Prebuilt Panels
•To create a prebuilt panel:
– Select Edit > Edit Panels
– In the panel's options menu, select
Convert to Prebuilt Panel
– Enter a Panel ID
– Select Private or Shared inApp permissions
– Click Save
1
2
4
3
5
Note
Repeat these steps on a converted prebuilt panel
to go back to an inline panel or panel from report.
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 69
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Adding Prebuilt Panels
•To add a prebuilt panel:
– Select Edit > Edit Panels
– Click +Add Panel
– Click Add Prebuilt Panel
– Select a panel
– Click Add to Dashboard
4
5
3
2
1
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 70
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Cloning Panels
•You can also add a panel
from another dashboard
by cloning the panel:
– Select Edit > Edit Panels
– Click +Add panel
– Click Clone from Dashboard
– Select a dashboard
– Select a panel
– Click Add to Dashboard
1
2
3
4
5
6
Note
You can also clone a panel from the Prebuilt
Panels page.
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 71
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Managing Panels
•To manage all prebuilt panels:
– Select Settings > User interface
– Click Prebuilt panels
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 72
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Grouping Panels
•Defined in simple XML
– Single value panels group horizontally
– All other panels group vertically
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 73
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Chart Customization
•Using the Panel Editor
– change chart axis labels
– define color ranges for gauges
– and much more
Default Chart
Options
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 74
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Chart Customization (cont.)
•Edit the panel XMLdirectly
to customize the appearance
and behavior of your charts
– axis label text styles
– reverse chart axes
– chart colors
– chart height
– and much more
Default Chart Colors
Custom Chart Colors
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 75
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Chart Customization – Example
• Changing Chart Colors
1. Add charting.fieldcolors option
2. Add hexidecimal for each data series
2
1
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 76
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Panel Customization – Example
• Changing Chart & Panel Colors
– Set background color: charting.backgroundColor
– Set foreground color: charting.foregroundColor
– Set font color: charting.fontColor
– Set series colors: charting.seriesColor
4
3
2
1
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 77
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Single Value Customization
Example: Using a timechart command to
get a total number of purchases over time.
4
3
2
1
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 78
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Single Value Customization (cont.)
Example: Using a stats command
to get a total number of purchases.
4
3
2
1
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 79
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Choropleth Map
•Uses shading to show relative metrics
•Color Modes
– Categorical mode: Identify regions that share the same value
– Divergent mode: Identify regions with high or low values.
– Sequential mode: Identify regions with high values.
Categorical Divergent Sequential
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 80
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Choropleth Map Components
•Data with location information
– latitude and longitude coordinates OR
– location names that match names in a lookup
•KMZ (Keyhole Markup Language) Lookup Table
– Defines region boundaries
– Built-in KMZ Lookups:
ê geo_us_states, United States
ê geo_countries, countries of the world
•Lookup definition
– Matches location coordinates in data to the KMZ file
– Built-in lookups definitions for the U.S. and world countries
KML files are not currently supported. Convert
a KML file into KMZ, by compressing the file
and replacing the '.zip' extension with '.kmz'
Note
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 81
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Choropleth Map Search
•Data with locations Transforming search geom Command
sourcetype=vendor_sales	
  VendorID	
  <	
  4000	
  	
  	
  	
  	
  	
  
|	
  stats	
  count	
  as	
  Sales	
  by	
  VendorStateProvince	
  	
  	
  	
  	
  	
  
|	
  geom	
  geo_us_states	
  featureIdField=VendorStateProvince	
  	
  
sourcetype=access_combined	
  status!=200	
  	
  
|	
  dedup	
  clientip	
  	
  
|	
  iplocation	
  prefix=cip_	
  clientip	
  	
  
|	
  stats	
  count	
  by	
  cip_Country	
  	
  
|	
  geom	
  geo_countries	
  featureIdField=cip_Country	
  
Example 2
Example 1
1
2
3
1
2
3
Display web server errors worldwide.
Scenario ?
Display vendor sales by U.S. State.
Scenario ?
1 2 3
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 82
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Global & Post Process Searches
•Specify the global search using
<search id="MyBaseSearch">
– Typically, the global search is a
transforming search
•Specify post process using
<search base="MyBaseSearch">
•Can use multiple global
searches on a dashboard
Passing a large number of search results from
a global search can cause a server time out.
Warning
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 83
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
• The global search must gather appropriate statistics for the downline processing
• The results are further processed
Global & Post Process Searches (cont.)
Base search ID
Base search reference
Post-process
Base search
Note
See also, Post-process searches in the
Dashboards & Visualizations manual
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 84
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
• Base search requires all fields identified in the data cube to have a value
• If necessary, remove null values in the post-process
Global & Post Process Searches – Null Values
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 85
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Lab 3 – Improve Performance
Time: 30 - 35 minutes
Tasks:
– Create prebuilt panels
– Create a dashboard
– Create a global search that uses:
▸tstats command
▸accelerated data model
– Add panels driven by post-process searches
– Add a choropleth map
– Customize chart and single value colors
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 86
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Module 4:
Creating Forms
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 87
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Module Objectives
Upon successful completion of this module, you will be able to:
•Name two types of forms
•Identify seven types of form inputs
•Describe how tokens work
•Use tokens to create:
– cascading menus
– dynamic drilldowns
– link switchers
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 88
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Dynamic Form
Forms
•Present a simplified search interface
•Hides an underlying search string
•Can be generated as PDFs
•Form types
– Simple: contain one or more input boxes
– Dynamic: inputs are dynamically
populated by searches
Simple Form
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 89
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Simple XML Syntax
•Form views begin and end with the <form></form> tags
•The <fieldset> tag defines a form input
Root element
Search to perform with
variable ($token$)
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 90
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Tokens
•Placeholder for dynamic values
•Use in search strings, form inputs,
panel titles, HTMLpanels, links,
and chart options
•When the value changes, all
related items are updated
sourcetype="vendor_sales"	
  product_name="$p_name$"	
  	
  
|	
  stats	
  count	
  by	
  VendorCity,	
  Vendor	
  |	
  sort	
  -­‐count	
  
Access the value of a token
using $...$ delimiters.
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 91
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Tokens – Example
Define in the form input.
Use in <title>	
  and <query>	
  
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 92
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Token Filters
Token filters ensure that you correctly capture the value of a token
Use Case	
   Token	
   Description
Wrap in quotes	
   $token_name|s$	
  	
  
Adds quotation marks around the value referenced
by the token and escapes those within the value.
HTML format	
   $token_name|h$	
  	
  
Ensures the token value is valid for HTML formatting.
Default for <HTML> element token values.
URL format	
   $token_name|u$	
  	
  
Ensures the token value is valid to use as a URL.
Default for <link> element token values.
If you include static text that contains the $ character,
use $$ to escape the token delimiter value.
Note
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 93
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Token Filters – Example
index=main	
  sourcetype="access_combined"	
  |	
  timechart	
  count	
  by	
  sourcetype	
   Here the value of sourcetype_tok
is access_combined in quotes.
<search>	
  
	
  <query>	
  
	
  	
  	
  index=main	
  sourcetype=$sourcetype_tok|s$	
  |	
  timechart	
  count	
  by	
  sourcetype	
  
	
  	
  </query>	
  
</search>	
  
Use the |s filter to place quotation
marks around the value returned.
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 94
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Tokens Summary
Use Case Defined Used Within Description Element
1 Search User defined Search string
Insert a term within a search string that uses a
value defined elsewhere.
<query>	
  
2 Inputs User defined Form input
Capture user input to modify the data displayed
in a panel.
<input>	
  
3 Multiple time pickers User defined Form panel
Indicate which time picker to use for each panel,
on forms with multiple time pickers.
<input	
  type=time>	
  
4 Conditional display User defined Dashboard panel Specify conditions for the display of panels and
their contents based on the value of the token.
Can be used with <drilldown> or <input>
<condition>	
  
5 Dynamic drilldown Predefined Dashboard panel Capture the value clicked for use in the drilldown. <drilldown>	
  
6 Pan and zoom Predefined Dashboard panel Select a time range within a chart to zoom into. <selection>	
  
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 95
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Form Inputs
•Seven types
– Text box
– Dropdown list
– Radio button
– Checkbox
– Multi-selection
– Time range picker
– Submit
•Add to a form or panel
– Drag inputs onto panels
•Free form input for multi-select
and dropdown
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 96
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Form Inputs – Text
Search that returns results to the
table – variable part of search (the
token) is surrounded by $’s
Part of the search
the user enters
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 97
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Form Inputs – Multi-select
Search that returns
results to table – the
variable (token) is
surrounded by $’s
Part of the search
the user selects
Search that generates
multiple select options
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 98
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Form Inputs – Checkbox
Search that generates
checkbox selections
Part of the search
the user selects
Search that returns
results to table – the
variable (token) is
surrounded by $’s
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 99
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Tokens – Cascading Inputs
Use the selection of one form
input to reduce or set the
values of another form input
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 100
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Tokens – Link Switcher
•Toggle dashboard content
– Time range
– Visualization
– Search Time picker
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 101
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Core Drilldown
•Allows for user interaction
with view objects
•Can dispatch a search on
chart or table elements
– Clicking an object redirects
you to search view
– Ctrl-clicking an object opens
search in new window
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 102
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Ultra Drilldown
•Provides drilldown options
without hidden modifier keys
•Click on an event to see a
contextual pop-up menu
– Add to search
– Exclude from search
– Create a search
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 103
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Dynamic Drilldown
•Pass a value to another panel, form,
dashboard or external site from:
– Chart
– Map
– Table row or field
– Multiple table fields
•Use hidden fields in tables
– Referenced only in drilldown links
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 104
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Dynamic Drilldown – Chart
Dashboard: use $click.value$ to pass a value from a chart click
token field destination value
target view path
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 105
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Dynamic Drilldown – Table Row
Dashboard: use $row.fieldname$ to pass a value from row click
token field destination value
target view path
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 106
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Dynamic Drilldown – Table Field
Dashboard: use the field=name option to pass a value from a field click
field=name option
Same syntax as table row
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 107
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Dynamic Drilldown – Destination Form
Add the token field to the search string to receive the value in the form view
replacement token
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 108
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Dynamic Drilldown – Multiple Table Fields
Dashboard: use field=name with multiple link tags to make multiple fields clickable
Same syntax as:
- table row
- table field
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 109
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Dynamic Drilldown – Multiple Table Fields (cont.)
Destination Form: Make sure you indicate default values for all token fields
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 110
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Dynamic Drilldowns – dest_value
Indicates the value to capture from a table or chart
dest_value Description Notes
click.name
click.name2
Passes the name of the field
that is clicked on.
• click.name: The value in a table column of the field that is clicked.
• click.name2: The value in a table row of the field that is clicked.
• Use with tables.
click.value
click.value2
Passes the value of the field
that is clicked on.
• click.value: The value in a table column of the field that is clicked.
• click.value2: The value in a table row of the field that is clicked.
• Use with all charts, except bar charts. For bar charts, these values are reversed.
• Multivalue fields in a table use click.value2.
earliest
latest
Passes the earliest and latest
times of a search.
• Use as parameters to URL for the target view.
• For example, add: &earliest=$earliest$&latest=$latest$ to the drilldown target view
URL. In this example, use CDATA to escape the '&’.
form.token
Passes the token accepted as
input by the target form.
• Use as a parameter to URL for the target form.
row.fieldname
Passes the value of the field
named, for the entire row.
• Specifies the field from the selected row or column from which to capture the value.
• Use with tables.
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 111
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Event Handlers
•Event handlers "listen" for specific events to occur, then perform
an event action:
– Set or unset tokens
– Execute an eval function
– Link to a page
•Three types of event handlers:
– Form inputs
– Searches
– Visualizations
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 112
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Event Action Syntax
•Set or unset tokens
<set	
  token="myToken">$text$</set>	
  
<unset	
  token="myToken">$text$</unset>	
  
•Execute an eval function
<eval	
  token="myToken">tostring(round('field'))</eval>	
  
•Link to a page
<link>/app/myApp/my_form?form.token=$text$</link>	
  
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 113
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Form Input Event Handler
•Use the <change> element to
capture the label or value from
an input and perform event actions
with them
•Applies to these inputs:
– checkbox
– dropdown
– link
– multiselect
– radio
– text
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 114
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Form Input Event Handler – Example
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 115
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Search Event Handler
•Use predefined tokens to access
search results or properties and
perform event actions with them
•Predefined tokens include:
– results.field: access the
value of the named field
– job.property: access the value
of the named search job property
See the Knowledge Manager Manual for
a complete list of search job properties.
Note
Search Event Description
<cancelled> Execute actions when a search is cancelled.
<done> Execute actions based on done search events.
<error> Execute actions when there is an error in the search.
<finalized> Execute an action when a search finalizes and data is
available
<progress> • Execute an action on search progress events.
• Similar to the preview event handler.
• Access job properties and field results. The progress
event has only job properties information available.
<preview> • Execute an action when search preview data is available.
• Similar to the progress event handler.
• Access job properties and field results. The preview
event has only preview information available.
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 116
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Search Event Handler – Example
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 117
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Visualization Event Handler
•Use the drilldown or selection elements to perform event actions
– Available for: chart, event, map, single, or table
•<selection>	
  	
  
– Sets the time window for the pan and zoom feature of charts
– Use tokens to set other values, such as the numerical values of a chart's x-axis
•<drilldown>	
  
– Enable event actions for drilldown behaviors
Selection element applies only to area,
column, or line charts.
Note
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 118
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Visualization Event Handler – Example
•Pan & Zoom
Example: Use <selection> in chart 1
to pick a time range for chart 2
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 119
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
condition Element
•Use with event handlers to specify the scope of event actions
•Define complex conditional matching, token filtering and formatting
•Use tokens based on search metadata, results, and job information
Attributes
Name Type Default Description
label text *
Specifies the input <label> element to which the condition
applies. '*' applies the condition to all input <label> elements.
match eval expression —
An eval expression that defines the conditions needed for
actions to be executed.
value text *
Specifies the input <value> element to which the condition
applies. '*' applies the condition to all input <value> elements.
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 120
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
condition Element – Input
•Specify actions based on input choices
The <condition> element is not
available for multiselect inputs.
Note
Example: Use conditional inputs to
select preset time ranges for a search.
<condition	
  label="[text]>">	
  	
  
..	
  actions	
  ...	
  	
  
</condition>	
  
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 121
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
condition Element – Search
•Specify the scope of actions based
on an eval expression
<condition	
  match="[eval	
  expression]>">	
  	
  
..	
  actions	
  ...	
  	
  
</condition>	
  
Example: If zero
results are returned,
show the html panel.
If the results = 0,
set a token called foob.
If there is a token called foob,
show the html panel.
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 122
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
condition Element – Drilldown
•Limits the scope of drilldown actions to clicks on specific fields and adds logic
<condition	
  field="[text]>">	
  	
  
..	
  actions	
  ...	
  	
  
</condition>	
  
Example: In-page
drilldown to hidden panel.
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 123
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Lab 4 – Add Interactivity
Time: 30 - 35 minutes
Tasks:
– Create a form
– Add cascading multiselect inputs
– Add chart panels
– Add a visualization event handler
– Add a dynamic drilldown
– Create a drilldown destination form
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 124
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Module 5:
Customizing Dashboards
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 125
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Module Objectives
Upon successful completion of this module, you will be able to:
•Use simple XMLextensions
•Identify types of search managers
•Link search managers to views
•Explain how autodiscovery works
•Add a D3 visualization to a dashboard
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 126
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Navigation
•Once you've built reports and views,
you can create navigation
– Go to Settings > User interface
> Navigation menus
– Select the app context for your view
– Edit the default file to specify the
order and menus for your views
nav menu
bar color
Default Navigation Bar
1
2
3
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 127
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Navigation (cont.)
Sub-menu with HTML pages
renamed for this menu
Views with file names
that include "marketing"
Searches with names
that include "Top"
All views not listed
in default.xml
Default view
Nav bar color
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 128
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Simple XML Extensions
•CSS and JavaScript extensions
•Customize the look and behavior of an app
by adding or modifying CSS & JS files in:
$APP_HOME/appserver/static	
  	
  
and referencing them in the view:
	
  <dashboard	
  stylesheet="my_style.css"	
  
	
  script="my_script.js">	
  
•Customize dashboards and panels
– For all, use: dashboard.css or dashboard.js
– For individual: my_style.css or my_script.js	
  
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 129
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Simple XML Extensions (cont.)
•Six extension points are provided:
– Drilldown: customize the drilldown event
for tables, charts, and other elements
– Visualization: integrate a custom
visualization as a panel
– Layout: make simple layout changes
– Stylesheet: use a custom CSS
– Table Cell Renderer: custom styles and
behaviors within table cells
– Token Setting: set custom tokens for a
dashboard page With simple XML extensions, you can still use the
visual editor and PDF generation is available.
Note
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 130
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Extension Points – Drilldown
table_drilldown_url_field.js
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 131
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Extension Points – Visualization
parallelcoords.js
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 132
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Extension Points – Layout
custom_layout_overlay_single.css
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 133
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Extension Points – Stylesheet
custom_decorations.css
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 134
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Extension Points – Table Cell Renderer
table_icons_inline.js table_decorations.css
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 135
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Extension Points – Tokens
Use JavaScript to set tokens in panel titles, html panels, and for drilldown.
set_app_token.js
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 136
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Linking Searches & Views
•Search ID for search
•Link the search to the
view with the search ID
•Reference the path
and JavaScript file
Search
1
3
1
2
3
2
View
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 137
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Linking Reports & Views
•Search ID for a report
(saved search)
•Link the report to the
view with the search ID
•Reference the path
and JavaScript file
1
3
1
2
2
Report
3
View
There is an assumed path that includes:
/appserver/static/
For example, "app/sales/appserver/static/
Important
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 138
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Linking Global Searches & Views
•Search ID for a
global search
•Post process
•Link the post process
to the view with the
search ID
1
2
3
2
1
3
Post process
View
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 139
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Troubleshooting
•Verify the manager id matches the search manager id
•Verify the path of data-­‐require
– app/<app_name>/path/to/<js_file_without_extension>	
  
•Verify all XMLattributes are properly escaped
– Escape all special characters in the search query: ' < > " 
•Verify any tokens with values that contain the $ character are escaped by
using two dollar signs: $$token$$	
  
•Verify the value of data-options is a valid JavaScript object
– Comma and quote placements
•Look for any JavaScript errors in the browser
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 140
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
SimpleSplunkView.js
•Extend this base class to create custom views
•Several methods that you can override as needed:
– initialize: the constructor
– formatData: formats results data from Splunk and returns a handle to the data
– formatResults: same as formatData, except you can format the full set of data
from the results model
– createView: configures the custom visualization and returns a handle to it
– updateView: puts Splunk data into the view
– clearView: resets rendering
– render: creates the initial view and draws it on the screen. On subsequent calls,
runs a full update cycle by calling formatResults, formatData, then updateView	
  
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 141
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Example – tagcloud.js
•Load dependencies
– Underscore and jquery libraries
– SimpleSplunkView base class
– any optional SplunkJS libraries
and stylesheets
•Declare a new class (inheriting
from SimpleSplunkView base
class) and its options
•Define any events
– Here, drilldown when clicking a tag
•Re-render the view when the
settings change
1
1
2
3
2
3
4
4
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 142
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Example – tagcloud.js (cont.)
•When the search runs,
update the view
– Clear the current view
– Extract and convert the
magnitude field value
– Find the maximum and minimum
of the magnitude values
– Calculate relative size of
each tag and render
5
5
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 143
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
autodiscover.js
•Re-use custom components,
especially visualizations, in
multiple dashboards and apps
•It looks for splunk-­‐view
or class elements in your
embedded JavaScript
•The splunkjs/ready script
must be loaded to perform
auto-discovery
autodiscover.js
splunkjs/ready! script should not be loaded before
dashboard renders. Ensure this by loading it within a
splunkjs/mvc/simplexml/ready! loader script callback.
Note
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 144
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
autodiscover.js (cont.)
•Two methods to enable auto-discover:
– Use a dedicated JavaScript file in the
appserver/static directory and load
the code from the dashboard using the
custom script attribute
– Include the code in dashboard.js
ê This loads automatically for every simple XML
dashboard within the app
ê With this method, auto-discovery works for all
dashboards without specifically enabling it
Dedicated JS file referenced in XML
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 145
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
HTML Conversion
•To work in HTML& JavaScript, you can easily convert simple XMLviews
– Then, add CSS, change the layout, edit the JavaScript to add interactivity, etc.
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 146
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
HTML Conversion (cont.)
•Layout is converted into Splunk styles
•Elements and forms are converted to
SplunkJS Stack equivalents
•Definition of each element and form
is converted into JavaScript
– Properties
– Auto-generated ID
•All searches are extracted and
represented in SplunkJS
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 147
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Lab 5 – Add Advanced Visualizations
Time: 25 - 30 minutes
Tasks:
– Create a dashboard
– Add simple xml extensions
– Add an HTMLpanel
– Add a search id
– Add search manager and visualization
Challenge Tasks:
– Add a D3 visualization
– Customize multiselect inputs
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 148
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Summary
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 149
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Wrap-up
You should now be able to:
•Generate, format, and customize charts
•Create dashboards and forms that use:
– dynamic drilldowns
– post process searches
– tokens
•Use JavaScript and CSS to create customize visualizations
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 150
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Wrap-up
You should now be able to:
•Use best practices for planning and creating views
•Define data structure requirements for visualizations
•Create efficient, well-formed searches that generate charts
•Edit simple xml to enable:
– dynamic drilldowns
– global searches
– tokens
•Use JavaScript and CSS to create interactive visualizations
•Troubleshoot views
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 151
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Next Steps
Apps
•Splunk Dashboard Examples
•Common Information Model
Courses
•Advanced Search & Reporting
•Building SplunkApps
•Splunk 6Administration
License
•Developer Trial License
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 152
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
Support Programs
• Community
– SplunkAnswers:answers.splunk.com
– SplunkDev:dev.splunk.com
– SplunkDocs:docs.splunk.com
– Wiki:wiki.splunk.com
– IRC Channel: #splunk on the EFNet IRC server
• Global Support
Supportforcriticalissues,adedicatedresourcetomanageyouraccount–24x7x365.
– Email:support@splunk.com
– Web:http://www.splunk.com/index.php/submit_issue
• Enterprise Support
– Access customer support by phone and manage your cases online 24 x 7
(depending on support contract).
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution
Advanced Dashboards & Visualizations
Listen to your data™ 153
Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015
• Complete the survey to be in this month's drawing for a $100 Splunk Store voucher
– Checkyourinboxforalinktothesurvey,oraccessthelinkontheMyProfilepage
Thank You
Generated for Marco Tavares (marco.tavares@foxtel.com.au) (C) Splunk Inc, not for distribution

More Related Content

Similar to 5DV Advanced_Dashboards_and_Visualisations.pdf (20)

PPTX
IBM Cognos Analytics Release 7+ Authoring Improvements: Demos of New and Rein...
Senturus
 
PDF
Splunk bangalore user group 2020-06-01
NiketNilay
 
PPTX
IBM Cognos Analytics Reporting vs. Dashboarding: Matching Tools to Business R...
Senturus
 
PDF
Forecast it - Agile in distributed teams - AgilityLab
Dennis Kayser
 
PPTX
Company Profile - NPC with TIBCO Spotfire solution
Sirinporn Setworaya
 
PDF
30 for 30: Quick Start Your Pentaho Evaluation
Pentaho
 
PDF
Webinar: Ten Ways to Enhance Your Salesforce.com Application in 2013
Emtec Inc.
 
PPTX
Getting Started with Splunk Breakout Session
Splunk
 
PPTX
Splunk User Group Edinburgh - November Event
Harry McLaren
 
PPTX
Advanced Use Cases for Analytics Breakout Session
Splunk
 
PDF
R to Forecast Solr Activity - Patrick Beaucamp, Bpm-Conseil
Lucidworks
 
PDF
Role of-analytics-in-db as-life
Navneet Upneja
 
PDF
Utilizing BI 11g Reporting To Get The Most Out of P6
p6academy
 
PDF
How Celtra Optimizes its Advertising Platform with Databricks
Grega Kespret
 
PPTX
Splunk Enterprise 6.3 - Splunk Tech Day
Zivaro Inc
 
PDF
Microsoft for BI and DW: Using the Right Tool for the Job
Senturus
 
PDF
(Oracle) DBA and Other Skills Needed in 2020
Markus Michalewicz
 
PPTX
Getting Started with Splunk Enterprise
Splunk
 
PPTX
Getting Started with Splunk Enterprise
Shannon Cuthbertson
 
PDF
7 Fatal Mistakes Made When Migrating From SP 2007 to SP 2010
Netwoven Inc.
 
IBM Cognos Analytics Release 7+ Authoring Improvements: Demos of New and Rein...
Senturus
 
Splunk bangalore user group 2020-06-01
NiketNilay
 
IBM Cognos Analytics Reporting vs. Dashboarding: Matching Tools to Business R...
Senturus
 
Forecast it - Agile in distributed teams - AgilityLab
Dennis Kayser
 
Company Profile - NPC with TIBCO Spotfire solution
Sirinporn Setworaya
 
30 for 30: Quick Start Your Pentaho Evaluation
Pentaho
 
Webinar: Ten Ways to Enhance Your Salesforce.com Application in 2013
Emtec Inc.
 
Getting Started with Splunk Breakout Session
Splunk
 
Splunk User Group Edinburgh - November Event
Harry McLaren
 
Advanced Use Cases for Analytics Breakout Session
Splunk
 
R to Forecast Solr Activity - Patrick Beaucamp, Bpm-Conseil
Lucidworks
 
Role of-analytics-in-db as-life
Navneet Upneja
 
Utilizing BI 11g Reporting To Get The Most Out of P6
p6academy
 
How Celtra Optimizes its Advertising Platform with Databricks
Grega Kespret
 
Splunk Enterprise 6.3 - Splunk Tech Day
Zivaro Inc
 
Microsoft for BI and DW: Using the Right Tool for the Job
Senturus
 
(Oracle) DBA and Other Skills Needed in 2020
Markus Michalewicz
 
Getting Started with Splunk Enterprise
Splunk
 
Getting Started with Splunk Enterprise
Shannon Cuthbertson
 
7 Fatal Mistakes Made When Migrating From SP 2007 to SP 2010
Netwoven Inc.
 

Recently uploaded (20)

PPTX
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
PDF
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
PPTX
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
PPTX
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
PDF
Exploring-the-Investigative-World-of-Science.pdf/8th class curiosity/1st chap...
Sandeep Swamy
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PDF
EXCRETION-STRUCTURE OF NEPHRON,URINE FORMATION
raviralanaresh2
 
PPTX
Applied-Statistics-1.pptx hardiba zalaaa
hardizala899
 
PPT
DRUGS USED IN THERAPY OF SHOCK, Shock Therapy, Treatment or management of shock
Rajshri Ghogare
 
PPTX
TOP 10 AI TOOLS YOU MUST LEARN TO SURVIVE IN 2025 AND ABOVE
digilearnings.com
 
PPTX
I INCLUDED THIS TOPIC IS INTELLIGENCE DEFINITION, MEANING, INDIVIDUAL DIFFERE...
parmarjuli1412
 
PPTX
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
PPTX
Unlock the Power of Cursor AI: MuleSoft Integrations
Veera Pallapu
 
DOCX
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
PPTX
Basics and rules of probability with real-life uses
ravatkaran694
 
PPTX
Digital Professionalism and Interpersonal Competence
rutvikgediya1
 
PPTX
10CLA Term 3 Week 4 Study Techniques.pptx
mansk2
 
PPTX
Various Psychological tests: challenges and contemporary trends in psychologi...
santoshmohalik1
 
PDF
My Thoughts On Q&A- A Novel By Vikas Swarup
Niharika
 
PPTX
Introduction to Probability(basic) .pptx
purohitanuj034
 
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
Exploring-the-Investigative-World-of-Science.pdf/8th class curiosity/1st chap...
Sandeep Swamy
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
EXCRETION-STRUCTURE OF NEPHRON,URINE FORMATION
raviralanaresh2
 
Applied-Statistics-1.pptx hardiba zalaaa
hardizala899
 
DRUGS USED IN THERAPY OF SHOCK, Shock Therapy, Treatment or management of shock
Rajshri Ghogare
 
TOP 10 AI TOOLS YOU MUST LEARN TO SURVIVE IN 2025 AND ABOVE
digilearnings.com
 
I INCLUDED THIS TOPIC IS INTELLIGENCE DEFINITION, MEANING, INDIVIDUAL DIFFERE...
parmarjuli1412
 
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
Unlock the Power of Cursor AI: MuleSoft Integrations
Veera Pallapu
 
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
Basics and rules of probability with real-life uses
ravatkaran694
 
Digital Professionalism and Interpersonal Competence
rutvikgediya1
 
10CLA Term 3 Week 4 Study Techniques.pptx
mansk2
 
Various Psychological tests: challenges and contemporary trends in psychologi...
santoshmohalik1
 
My Thoughts On Q&A- A Novel By Vikas Swarup
Niharika
 
Introduction to Probability(basic) .pptx
purohitanuj034
 
Ad

5DV Advanced_Dashboards_and_Visualisations.pdf

  • 1. Advanced Dashboards & Visualizations Listen to your data™ 1 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Advanced Dashboards & Visualizations Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 2. Advanced Dashboards & Visualizations Listen to your data™ 2 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Document Usage Guidelines •Should be used only by enrolled students •Not meant to be a self-paced document, an instructor is needed •Do not distribute 6 November 2015 Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 3. Advanced Dashboards & Visualizations Listen to your data™ 3 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Course Prerequisites Classes • Splunk Tutorial (eLearning) • Using Splunk (ILT or eLearning) • Searching and Reporting with Splunk (ILT) • Creating Splunk Knowledge Objects (ILT) Skills • Working knowledge of HTML • Some XMLand JavaScript experience (recommended) In order to receive credit for this course, you must complete all lab exercises. Important Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 4. Advanced Dashboards & Visualizations Listen to your data™ 4 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Course Goals Upon completion of this course you will be able to: •Use best practices for planning and creating views •Define data structure requirements for visualizations •Create efficient, well-formed searches that generate charts •Edit simple xml to enable: – dynamic drilldowns – global searches – tokens •Use JavaScript and CSS to create interactive visualizations •Troubleshoot views Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 5. Advanced Dashboards & Visualizations Listen to your data™ 5 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Course Outline Module 1: Introduction to Views Module 2:Adding Content Module 3: Using Simple XML Module 4: Creating Forms Module 5: Customizing Dashboards Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 6. Advanced Dashboards & Visualizations Listen to your data™ 6 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Course Scenario •As in the other Splunk courses, the use cases in this course are based on Buttercup Games, a gaming company •The views are based on business analytics from web access logs and lookups Data Host   Sourcetype   Online transactions & web server www1 access_combined linux_secure   www2 www3 Retail sales data vendorUS1 vendor_sales   Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 7. Advanced Dashboards & Visualizations Listen to your data™ 7 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Callouts Scenarios •Many of the examples in this course relate to a specific scenario •For each example, a question is posed from a colleague or manager at Buttercup Games Notes & Tips •References for more information on a topic and tips for best practices How can we use an view to limit types of searches? Scenario ? Functions and arguments used with stats and chart can also be used with timechart. Note Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 8. Advanced Dashboards & Visualizations Listen to your data™ 8 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Module 1: Introduction to Views Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 9. Advanced Dashboards & Visualizations Listen to your data™ 9 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Module Objectives Upon successful completion of this module, you will be able to: •Define what is a view •Identify best practices for creating views •Define the common information model •Normalize data to CIM Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 10. Advanced Dashboards & Visualizations Listen to your data™ 10 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 What is a view? •Every page in Splunk Web is a view – Dashboards – Forms •Each view is a web page built from: – XMLfile that defines the content – HTMLfile that defines the layout – CSS and JavaScript files that define the appearance and interactions Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 11. Advanced Dashboards & Visualizations Listen to your data™ 11 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Dashboards •Most common type of view •Collection of data visualizations that tell a meaningful story •Display results as event list or in graphical form: charts, graphs, tables, etc. •Typically, limited user input •Default interactive features – Mouse over values, core drill-down Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 12. Advanced Dashboards & Visualizations Listen to your data™ 12 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Forms •An interface that allows users to enter values for one or more search terms from a variety of inputs •Shield users from the details of the underlying search Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 13. Advanced Dashboards & Visualizations Listen to your data™ 13 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Dashboards & Forms •Similarities – Layout of rows, panels, and panel visualizations •Differences – Top-level element: <dashboard> and <form> – Forms have user inputs: time range picker, drop-down lists, radio buttons, text box, etc. Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 14. Advanced Dashboards & Visualizations Listen to your data™ 14 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Stakeholders •Depending on the complexities of your dashboard, your stakeholders may include: – SplunkAdministrator – JavaScript developer – Security expert – Business user – UX designer •Questions to ask: – How will users access your dashboards? – Will the dashboards use JavaScript? – Should the views be deployed with their own app? Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 15. Advanced Dashboards & Visualizations Listen to your data™ 15 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Best Practice • Plan: Identify key metrics, time frames, visualizations; then, wireframe the view • Add content: Create basic searches, views, and visualizations • Add interactivity: Add buttons, inputs, tokens, and dynamic drilldowns • Get stakeholder sign-off • Refine: Optimize searches, add tokens, use post-processes, create macros and data models • Customize: Add custom features available with CSS and JavaScript Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 16. Advanced Dashboards & Visualizations Listen to your data™ 16 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Plan •An iterative process between you and the stakeholders – What critical metrics do users want? – What is the time span for the data? – What is the timeframe for refreshing data? – What visualizations will be required? – What should the layout look like? •Wireframing is the process of designing a view through prototyping Use sketches then build Or add a static version as an interim step Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 17. Advanced Dashboards & Visualizations Listen to your data™ 17 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Managing Views Views are scoped to your app context and permissions can be applied to it 1 2 4 3 Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 18. Advanced Dashboards & Visualizations Listen to your data™ 18 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Troubleshooting Views •Examine the panel's search – Check for syntax errors – Run it manually in the relevant app context •View all previous searches with their stats – Run | history •Examine the view's source – Appending "?showsource=1" – Use "&showsource=1" if other parameters have already been appended – Expand macros and event types Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 19. Advanced Dashboards & Visualizations Listen to your data™ 19 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Troubleshooting Views – Job Inspector Examine impact of knowledge object processing, such as event types, tags, lookups and so on Click inspect to open the job inspector For more information on the Job Inspector, see the Knowledge Manager Manual. Note 1 2 Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 20. Advanced Dashboards & Visualizations Listen to your data™ 20 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Troubleshooting Views – Job Inspector (cont.) Debug messages You won't see these messages until the search has completed. Note Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 21. Advanced Dashboards & Visualizations Listen to your data™ 21 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Common Information Model •Methodology to normalize data •Match a common standard, using the same field names and event tags for equivalent events from different sources or vendors Normalized Field Names Data Source 2 Data Source 1 Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 22. Advanced Dashboards & Visualizations Listen to your data™ 22 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Splunk CIM Add-on •Set of 22 pre-configured data models – Fields and event category tags – Least common denominator of a domain of interest •Leverage the CIM so that knowledge objects in multiple apps can co-exist on a single Splunk deployment The data models included in the CIM add-on are configured with data model acceleration turned off. Note Splunk CIM Add-On Data Models Alerts Java Virtual Machines (JVM) Application State Malware Authentication Network Resolution (DNS) Certificates Network Sessions Change Analysis Network Traffic CIM Validation (S.o.S) Performance Databases Splunk Audit Logs Email Ticket Management Interprocess Messaging Updates Intrusion Detection Vulnerabilities Inventory Web Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 23. Advanced Dashboards & Visualizations Listen to your data™ 23 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Get Data In 1 Using the CIM Examine Your Data Create Event Types & Tags Create Field Aliases 2 3 4 6 Validate Against Model ✓ ✓ ✓ Best Practice Add Missing Fields & Tags 5 Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 24. Advanced Dashboards & Visualizations Listen to your data™ 24 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Using the CIM (cont.) •Examine Your Data – Go to Settings > Data Models – Identify a data model relevant to your dataset Object Hierarchy Data Types Tags and Other Constraints Inherited Fields Extracted Fields 2 Keep the CIM Reference Tables in Splunk Docs page open in a separate tab. Best Practice Calculated Fields Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 25. Advanced Dashboards & Visualizations Listen to your data™ 25 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Using the CIM (cont.) •Create Event Types & Tags – Identify the CIM objects relevant to your events – Observe which tags are required for that object or any parent objects – Apply those tags to your events using event types 3 Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 26. Advanced Dashboards & Visualizations Listen to your data™ 26 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Using the CIM (cont.) •Create FieldAliases – Determine whether any existing fields in your data have different names than the names expected by the data models – Define field aliases to capture the differently named field in your original data and map it to the field name that the CIM expects 4 Field name in CIM object Field name in your data Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 27. Advanced Dashboards & Visualizations Listen to your data™ 27 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Using the CIM (cont.) •Add Missing Fields – Create field extractions – Write lookups to add fields and normalize field values •ValidateAgainst Data Model – Using datamodel command OR – Using Pivot in Splunk Web 5 6 For more information, see the Common Information Model Add-on Manual. Note Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 28. Advanced Dashboards & Visualizations Listen to your data™ 28 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 datamodel  Command •Search against a specified data model object •Return a description of all or a specified data model and its objects •Is a generating command and should be the first command in the pipeline                   The object name and search keyword aren't valid unless preceded by the data model name. The keyword search cannot be substituted with a search string or name. Important Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 29. Advanced Dashboards & Visualizations Listen to your data™ 29 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 datamodel  Command – Example A |  datamodel  Web  Web  search  |  fields  Web*   A B C command data model name data model object name keyword find field names with Web prefix B C D D When using the datamodel command, the data model name and object name are case-sensitive Note Object name prepended to field names in your data E E Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 30. Advanced Dashboards & Visualizations Listen to your data™ 30 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Lab 1 – Get to Know Your Data Time: 20 – 25 minutes Tasks: – Log into Splunk Web – Change the account name and time zone – Examine the use case and wireframe – Make your data CIM-compliant Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 31. Advanced Dashboards & Visualizations Listen to your data™ 31 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Module 2: Adding Content Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 32. Advanced Dashboards & Visualizations Listen to your data™ 32 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Module Objectives Upon successful completion of this module, you will be able to: •Define data structure requirements •Identify the primary transforming commands •Split values into multiple series •Chart multiple values on the same timeline Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 33. Advanced Dashboards & Visualizations Listen to your data™ 33 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Create Basic Searches •Basic, hard coded searches – Add tokens, macros, data models later •Use naming conventions – At least the same prefix –Group, search type, view type, platform, category, time interval, description, and project Command Description bucket Puts continuous numerical values into discrete sets. chart Returns results in a tabular output for charting. dedup Removes subsequent results that match a specified criteria. eval Calculates an expression and puts the value into a field. fields Adds or removes fields from search results. lookup Explicitly invokes field value lookups. multikv Extracts field-values from table-formatted events. rangemap Sets RANGE field to the name of the ranges that match. rex Specify a Perl regular expression named groups to extract fields while you search. spath Extracts key-value pairs from XML or JSON formats. stats Provides statistics, grouped optionally by fields. timechart Create a time series chart and corresponding table of statistics. transaction Groups search results into transactions. where Performs arbitrary filtering on your data. Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 34. Advanced Dashboards & Visualizations Listen to your data™ 34 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Data Structure Requirements •Search not generating any statistical values, or the visualization you want not available? •Modify the search to get the visualization you want Data series: a sequence of related data points that are plotted in a chart. Note Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 35. Advanced Dashboards & Visualizations Listen to your data™ 35 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Data Structure Requirements – Single Series •Search results structured as tables with at least two columns – First column provides x-axis values – Second column provides y-axis values for the chart sourcetype=vendor_sales     |  chart  avg(price)  over  Vendor   Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 36. Advanced Dashboards & Visualizations Listen to your data™ 36 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Data Structure Requirements – Multi-Series •Search results structured as tables with three or more columns – First column provides x-axis values – Subsequent columns provide y-axis values for each series in the chart – Underlying search must use transforming commands like stats, chart, or timechart sourcetype=vendor_sales  VendorID<4000   |  chart  count  over  VendorCountry        by  product_name  limit=5  useother=f   Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 37. Advanced Dashboards & Visualizations Listen to your data™ 37 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Data Structure Requirements – Time Series •Time series display statistical trends over time – Any search using the timechart command – First column provides _time values – Subsequent columns provide y-axis values for each series in the chart • Underlying search must use transforming commands like stats, chart, or timechart sourcetype=access_combined  action=purchase  status=200   |  timechart  count(action)  by  host   Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 38. Advanced Dashboards & Visualizations Listen to your data™ 38 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Data Structure Requirement Summary Built-in Visualization Series Dimensions Table Columns Column, line, and area charts single, multiple 2 Two column minimum: first = x-axis, second = y-axis, additional = y-axis Bar charts single, multiple 2 Two column minimum: first = y-axis, second = x-axis, additional = x-axis Pie charts single 1 Two column: first = slice label, second = label value, additional = ignored Bubble charts single, multiple 4 Three column: first = series label, second = x-axis, third = y-axis (numerical for best results), additional = ignored Scatter charts single, multiple 3 Two or three columns: single series (two column): first = x-axis, second = y-axis, multiple series (three column): first = series names, second = x-axis, third: y-axis Single value – 1 One column Gauges single 1 Two column: first = range value, second = x-axis, additional = ignored Map single 2 Two column: first = slice label, second = label value, third = longitude, fourth = latitude Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 39. Advanced Dashboards & Visualizations Listen to your data™ 39 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Transforming Commands •Required to transform search results into visualizations •The primary transforming commands are: – chart: displays any series of data that you want to plot – timechart: displays trend over time; display _time on the x-axis – stats, eventstats, geostats, geom, and streamstats: display summary statistics – top: displays the most common values of a field – rare: displays the least common values of a field – associate, correlate, and diff: display associations, correlations, and differences between fields in your data Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 40. Advanced Dashboards & Visualizations Listen to your data™ 40 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Statistical Functions •These five transforming commands work with statistical functions: – chart, timechart, stats, eventstats, streamstats •Available statistical functions: – count, distinct count – mean, median, mode – min, max, range, percentiles – standard deviation, variance – sum – first occurrence, last occurrence sourcetype=access_combined  action=purchase     |  timechart  span=1h      min(price)  as  min,        max(price)  as  max,        mean(price)  as  mean,        median(price)  as  median,        stdev(price)  as  "standard  dev",        range(price)  as  range   Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 41. Advanced Dashboards & Visualizations Listen to your data™ 41 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Characteristic Visualization Temporal Data Stacked Line and Area Charts Y-Axis is Numerical Line, Area, Column Charts X-Axis is Numerical Bar Chart Constituent Totals Stacked Bar, Column Charts Percentage Pie Chart Discrete Events Scatterplot Discrete Events with X, Y, Z axis Bubble Chart Lots of measures at once, High-level Single Value Gauge Compare Locations Map Splunk Visualizations Charts Single Value Maps Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 42. Advanced Dashboards & Visualizations Listen to your data™ 42 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Which Visualization Should I Use? Do I have at least 3 or 4 dimensions of data? Yes: use a scatterplot or bubble chart No, two dimensions: use a line or area chart No, one dimension: use a bar chart, column chart, line chart or area chart Do I need to show something changing in time? Yes: use the timechart command to plot a line, column, area, or a stacked area chart Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 43. Advanced Dashboards & Visualizations Listen to your data™ 43 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 xyseries Command •xyseries  <x-­‐field>  <y-­‐name-­‐field>  <y-­‐data-­‐field>     •<x-­‐field> is the field to use as the x-axis •<y-­‐name-­‐field> is the field that contains the values to be used as labels for the data series •<y-­‐data-­‐field> is the field(s) that contains the data to be charted Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 44. Advanced Dashboards & Visualizations Listen to your data™ 44 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 xyseries Command – Example Evaluate online sales for the previous month. Scenario ? A B C sourcetype=access_combined  action=purchase     |  stats  count  by  product_name  categoryId     |  where  count  >  20   |  xyseries      product_name      categoryId      count     |  fillnull  value=-­‐   A B C Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 45. Advanced Dashboards & Visualizations Listen to your data™ 45 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 xyseries vs. stats   •Generally, instead of xyseries, you would use chart  a  over  b  by  c   chart  a  over  b  by  c  is equivalent to: stats  a  by  b,c  |  xyseries  b  c  a   •However, if you need to do some processing after the chart command, use stats followed by xyseries   Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 46. Advanced Dashboards & Visualizations Listen to your data™ 46 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 chart vs. xyseries – Examples sourcetype=vendor_sales     |  chart  count(price)  as  count  over        product_name  by  categoryId   |  fillnull  value=0   sourcetype=vendor_sales     |  chart  count(price)  as  count  over        product_name  by  categoryId   |  where  count  >  100   sourcetype=vendor_sales     |  stats  count(price)  as  count  by        product_name,  categoryId     |  where  count  >  100     |  xyseries  product_name,  categoryId,  count     |  fillnull  value=0   A B C Display the number of retail sales the previous week that exceeded 100, by product name and category. Scenario ? A B C Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 47. Advanced Dashboards & Visualizations Listen to your data™ 47 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Improving Performance •Refine Searches •Create Reports •Schedule Reports •Accelerate Reports •Use Summary Indexes •Accelerate Data Models •Use tstats Command •Use Tokens Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 48. Advanced Dashboards & Visualizations Listen to your data™ 48 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Schedule Reports •Schedule a new report when you save a search or pivot •Schedule an existing report: – Navigate to the Reports page, and locate the report – In theActions column, click Edit > Edit Schedule – Select a Schedule type ▸Basic: choose from a range of preset options ▸Cron: set up a schedule using standard cron – Select a Schedule Window (optional) Note:Thisisforwhentherearemanyconcurrently scheduledreports. 1 2 3 4 Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 49. Advanced Dashboards & Visualizations Listen to your data™ 49 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Refine Searches •Use the most efficient command for the use case – tstats – stats vs. transaction •Make the base search as specific as possible ...  |  transaction  trade_id  |  chart  count  by  duration     ...  |  stats  range(_time)  as  duration  by  trade_id     |  chart  count  by  duration     Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 50. Advanced Dashboards & Visualizations Listen to your data™ 50 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Refine Searches (cont.) •Restrict your search to the specific host, index, source, source type, or Splunk server •Limit your search to a specific time window •Limit the quantity of data retrieved – For example, use the head command: sourcetype=access_* | head 1000. •Avoid using NOT expressions when possible – Instead of using (NOThost=d NOThost=e) or (host!=d OR host!=e), use (host=a OR host=b OR host=c) Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 51. Advanced Dashboards & Visualizations Listen to your data™ 51 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Search Acceleration Report Acceleration • Accelerates individual reports • Uses automatically-created summaries to speed completion times for qualified reports • Easier to create than summary indexes and backfill automatically • Depending on the defined time span, periodically ages out data • Can correct gaps and overlaps from the UI 'rebuild' feature • Cannot create a data cube and report on smaller subsets Summary Indexing • Accelerates reports that don't qualify for report acceleration • Uses manually created summary indexes that exist separate from main indexes • Useful for searches that don't qualify for report acceleration • Can persist after events have been frozen by controlling retention period or index size • Backfill is a manual (scripted) process Data Model Acceleration • Accelerates all of the fields defined in a data model • Uses automatically-created summaries to speed completion times for pivots • Takes the form of time-series index files Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 52. Advanced Dashboards & Visualizations Listen to your data™ 52 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Report Acceleration • You – Your role has the schedule search capability – You have write permissions for the report you want to accelerate • The report – Was not created via Pivot – The underlying search qualifies for acceleration: ▸usesatransformingcommand(suchaschart,timechart,stats,andtop) ▸onlystreamingcommandsbeforethetransformingcommand ▸basesearchdoesnotuseeventsampling • Search Mode – If the underlying search uses verbose mode, it is automagically changed to smart or fast – You cannot change search mode of an accelerated report to verbose Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 53. Advanced Dashboards & Visualizations Listen to your data™ 53 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 When Splunk Does NOTAccelerate Reports •Splunk generally won't generate a summary if: – There are fewer than 100K events in the summary range – It’s faster executing the search without a summary – Summary size is projected to be too large – It’s faster executing the search because the main index is smaller •If a summary is defined and not created for the above reasons, Splunk continues to check periodically, then automatically creates a summary after it meets the requirements Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 54. Advanced Dashboards & Visualizations Listen to your data™ 54 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Summary Indexing •Efficiently report on large volumes of data – When a search is run results are saved to a summary index – Then you can run searches against this smaller, and thus faster, summary index – Allows the cost of a computationally expensive report to be spread over time •Amortize costs of reports, over different but overlapping time range – Summary data generated on aTuesday can be used for a report of the previous 7 days done on the Wednesday,Thursday, or the following Monday. Summary indexing volume is not counted against your license, even if you have multiple summary indexes. Note Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 55. Advanced Dashboards & Visualizations Listen to your data™ 55 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Accelerate Data Models •Use to speed up data models that represent extremely large datasets •Speeds up reporting for the entire set of attributes (fields) – Report acceleration and summary indexing speed up individual searches on a report by report basis •Set of .tsidx file summaries is created and scheduled searches are run every five minutes to keep current •Affects only event object hierarchies •Most efficient if the root event objects include the index(es) in their initial constraint search Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 56. Advanced Dashboards & Visualizations Listen to your data™ 56 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 tstats Command •Perform statistical queries on indexed fields in tsidx files – Normal index data – tscollect data – Accelerated Data Models •Query the tsidx files of a specific accelerated data model in Search •Verify a data model is capturing the data you expect Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 57. Advanced Dashboards & Visualizations Listen to your data™ 57 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 tstats Command – Example •Agenerating processor, so it must be the first command in a search pipeline •Use prestats to pipe results to chart or timechart for creating visualizations ...|  tstats  prestats=t  count  by  _time  span=1d          |  timechart  span=1d  count     Gives a timechart of all the data in your default indexes with a day granularity. Scenario ? Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 58. Advanced Dashboards & Visualizations Listen to your data™ 58 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Lab 2 – Create a Prototype Time: 25 – 30 minutes Questions: – Answer a set of questions concerning types of searches. Tasks: – Create a dashboard with basic searches – Schedule and accelerate reports Challenge Task: – Create a data model Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 59. Advanced Dashboards & Visualizations Listen to your data™ 59 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Module 3: Using Simple XML Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 60. Advanced Dashboards & Visualizations Listen to your data™ 60 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Module Objectives Upon successful completion of this module, you will be able to: •Define the simple XMLsyntax •Name three types of dashboard panels •Identify six simple XMLpanel objects •Create a dashboard with panels that use post process searches Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 61. Advanced Dashboards & Visualizations Listen to your data™ 61 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Simple XML •Create and modify dashboards without writing any simple XMLcode – Dashboard editor – Form editor – Visualization editor •Can also code simple XML – Custom charts, gauges, and rangemaps – Dynamic drilldown behaviors – Tokenization – Post-process searches …and much more Visualization Editor Dashboard & Form Editor Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 62. Advanced Dashboards & Visualizations Listen to your data™ 62 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Simple XML (cont.) •There are many ways to customize views by editing the simple XML – Layout – Tokenization – CSS styles – Custom scripts Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 63. Advanced Dashboards & Visualizations Listen to your data™ 63 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Simple XML Syntax Label Root Element <dashboard>   <label>Your  Dashboard  Title</label>   ...   </dashboard>   Chart Title Panel Title Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 64. Advanced Dashboards & Visualizations Listen to your data™ 64 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Simple XML Syntax (cont.) inline search chart Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 65. Advanced Dashboards & Visualizations Listen to your data™ 65 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 CDATATags •Special characters in XML files – Some characters have special meaning in an XMLfile and cannot be used literally. – Wrap the text with special characters within CDATAtags. – Or escape special characters using HTMLentities. Character   HTML  En/ty   ' &apos; < &lt; > &gt; & &amp; <link> <![CDATA[ /app/search/form_for_drilldown? form.sourcetype=$row.sourcetype$&earliest= $earliest$&latest=$latest$ ]]> </link> The search in this dynamic drilldown has an ampersand CDATA Tags <![CDATA[  "Text  within  tags"  ]]>   Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 66. Advanced Dashboards & Visualizations Listen to your data™ 66 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Panels Each panel has six possible visualization elements: Panel Description Create or Edit Using 1. Chart Displays search results as a chart Visualization editor or XML editor 2. Event List Displays search results as individual events Visualization editor or XML editor 3. HTML Displays inline HTML XML editor only 4. Map Displays search results as map Visualization editor or XML editor 5. Single value Displays a single value visualization and various styles of gauges Visualization editor or XML editor 6. Table Displays search results as a table Visualization editor or XML editor In Splunk 6 and prior, panel type referred to a visualization. In with Splunk 6.1 and later a panel is a container for a visualization. Note Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 67. Advanced Dashboards & Visualizations Listen to your data™ 67 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Panel Categories •Inline: displays content of a search string or post-process •Report: displays contents of a report •Prebuilt: displays contents of a preexisting panel Inline Panel Report Panel Prebuilt Panel Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 68. Advanced Dashboards & Visualizations Listen to your data™ 68 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Creating Prebuilt Panels •To create a prebuilt panel: – Select Edit > Edit Panels – In the panel's options menu, select Convert to Prebuilt Panel – Enter a Panel ID – Select Private or Shared inApp permissions – Click Save 1 2 4 3 5 Note Repeat these steps on a converted prebuilt panel to go back to an inline panel or panel from report. Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 69. Advanced Dashboards & Visualizations Listen to your data™ 69 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Adding Prebuilt Panels •To add a prebuilt panel: – Select Edit > Edit Panels – Click +Add Panel – Click Add Prebuilt Panel – Select a panel – Click Add to Dashboard 4 5 3 2 1 Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 70. Advanced Dashboards & Visualizations Listen to your data™ 70 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Cloning Panels •You can also add a panel from another dashboard by cloning the panel: – Select Edit > Edit Panels – Click +Add panel – Click Clone from Dashboard – Select a dashboard – Select a panel – Click Add to Dashboard 1 2 3 4 5 6 Note You can also clone a panel from the Prebuilt Panels page. Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 71. Advanced Dashboards & Visualizations Listen to your data™ 71 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Managing Panels •To manage all prebuilt panels: – Select Settings > User interface – Click Prebuilt panels Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 72. Advanced Dashboards & Visualizations Listen to your data™ 72 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Grouping Panels •Defined in simple XML – Single value panels group horizontally – All other panels group vertically Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 73. Advanced Dashboards & Visualizations Listen to your data™ 73 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Chart Customization •Using the Panel Editor – change chart axis labels – define color ranges for gauges – and much more Default Chart Options Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 74. Advanced Dashboards & Visualizations Listen to your data™ 74 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Chart Customization (cont.) •Edit the panel XMLdirectly to customize the appearance and behavior of your charts – axis label text styles – reverse chart axes – chart colors – chart height – and much more Default Chart Colors Custom Chart Colors Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 75. Advanced Dashboards & Visualizations Listen to your data™ 75 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Chart Customization – Example • Changing Chart Colors 1. Add charting.fieldcolors option 2. Add hexidecimal for each data series 2 1 Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 76. Advanced Dashboards & Visualizations Listen to your data™ 76 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Panel Customization – Example • Changing Chart & Panel Colors – Set background color: charting.backgroundColor – Set foreground color: charting.foregroundColor – Set font color: charting.fontColor – Set series colors: charting.seriesColor 4 3 2 1 Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 77. Advanced Dashboards & Visualizations Listen to your data™ 77 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Single Value Customization Example: Using a timechart command to get a total number of purchases over time. 4 3 2 1 Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 78. Advanced Dashboards & Visualizations Listen to your data™ 78 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Single Value Customization (cont.) Example: Using a stats command to get a total number of purchases. 4 3 2 1 Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 79. Advanced Dashboards & Visualizations Listen to your data™ 79 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Choropleth Map •Uses shading to show relative metrics •Color Modes – Categorical mode: Identify regions that share the same value – Divergent mode: Identify regions with high or low values. – Sequential mode: Identify regions with high values. Categorical Divergent Sequential Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 80. Advanced Dashboards & Visualizations Listen to your data™ 80 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Choropleth Map Components •Data with location information – latitude and longitude coordinates OR – location names that match names in a lookup •KMZ (Keyhole Markup Language) Lookup Table – Defines region boundaries – Built-in KMZ Lookups: ê geo_us_states, United States ê geo_countries, countries of the world •Lookup definition – Matches location coordinates in data to the KMZ file – Built-in lookups definitions for the U.S. and world countries KML files are not currently supported. Convert a KML file into KMZ, by compressing the file and replacing the '.zip' extension with '.kmz' Note Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 81. Advanced Dashboards & Visualizations Listen to your data™ 81 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Choropleth Map Search •Data with locations Transforming search geom Command sourcetype=vendor_sales  VendorID  <  4000             |  stats  count  as  Sales  by  VendorStateProvince             |  geom  geo_us_states  featureIdField=VendorStateProvince     sourcetype=access_combined  status!=200     |  dedup  clientip     |  iplocation  prefix=cip_  clientip     |  stats  count  by  cip_Country     |  geom  geo_countries  featureIdField=cip_Country   Example 2 Example 1 1 2 3 1 2 3 Display web server errors worldwide. Scenario ? Display vendor sales by U.S. State. Scenario ? 1 2 3 Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 82. Advanced Dashboards & Visualizations Listen to your data™ 82 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Global & Post Process Searches •Specify the global search using <search id="MyBaseSearch"> – Typically, the global search is a transforming search •Specify post process using <search base="MyBaseSearch"> •Can use multiple global searches on a dashboard Passing a large number of search results from a global search can cause a server time out. Warning Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 83. Advanced Dashboards & Visualizations Listen to your data™ 83 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 • The global search must gather appropriate statistics for the downline processing • The results are further processed Global & Post Process Searches (cont.) Base search ID Base search reference Post-process Base search Note See also, Post-process searches in the Dashboards & Visualizations manual Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 84. Advanced Dashboards & Visualizations Listen to your data™ 84 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 • Base search requires all fields identified in the data cube to have a value • If necessary, remove null values in the post-process Global & Post Process Searches – Null Values Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 85. Advanced Dashboards & Visualizations Listen to your data™ 85 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Lab 3 – Improve Performance Time: 30 - 35 minutes Tasks: – Create prebuilt panels – Create a dashboard – Create a global search that uses: ▸tstats command ▸accelerated data model – Add panels driven by post-process searches – Add a choropleth map – Customize chart and single value colors Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 86. Advanced Dashboards & Visualizations Listen to your data™ 86 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Module 4: Creating Forms Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 87. Advanced Dashboards & Visualizations Listen to your data™ 87 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Module Objectives Upon successful completion of this module, you will be able to: •Name two types of forms •Identify seven types of form inputs •Describe how tokens work •Use tokens to create: – cascading menus – dynamic drilldowns – link switchers Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 88. Advanced Dashboards & Visualizations Listen to your data™ 88 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Dynamic Form Forms •Present a simplified search interface •Hides an underlying search string •Can be generated as PDFs •Form types – Simple: contain one or more input boxes – Dynamic: inputs are dynamically populated by searches Simple Form Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 89. Advanced Dashboards & Visualizations Listen to your data™ 89 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Simple XML Syntax •Form views begin and end with the <form></form> tags •The <fieldset> tag defines a form input Root element Search to perform with variable ($token$) Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 90. Advanced Dashboards & Visualizations Listen to your data™ 90 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Tokens •Placeholder for dynamic values •Use in search strings, form inputs, panel titles, HTMLpanels, links, and chart options •When the value changes, all related items are updated sourcetype="vendor_sales"  product_name="$p_name$"     |  stats  count  by  VendorCity,  Vendor  |  sort  -­‐count   Access the value of a token using $...$ delimiters. Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 91. Advanced Dashboards & Visualizations Listen to your data™ 91 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Tokens – Example Define in the form input. Use in <title>  and <query>   Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 92. Advanced Dashboards & Visualizations Listen to your data™ 92 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Token Filters Token filters ensure that you correctly capture the value of a token Use Case   Token   Description Wrap in quotes   $token_name|s$     Adds quotation marks around the value referenced by the token and escapes those within the value. HTML format   $token_name|h$     Ensures the token value is valid for HTML formatting. Default for <HTML> element token values. URL format   $token_name|u$     Ensures the token value is valid to use as a URL. Default for <link> element token values. If you include static text that contains the $ character, use $$ to escape the token delimiter value. Note Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 93. Advanced Dashboards & Visualizations Listen to your data™ 93 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Token Filters – Example index=main  sourcetype="access_combined"  |  timechart  count  by  sourcetype   Here the value of sourcetype_tok is access_combined in quotes. <search>    <query>        index=main  sourcetype=$sourcetype_tok|s$  |  timechart  count  by  sourcetype      </query>   </search>   Use the |s filter to place quotation marks around the value returned. Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 94. Advanced Dashboards & Visualizations Listen to your data™ 94 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Tokens Summary Use Case Defined Used Within Description Element 1 Search User defined Search string Insert a term within a search string that uses a value defined elsewhere. <query>   2 Inputs User defined Form input Capture user input to modify the data displayed in a panel. <input>   3 Multiple time pickers User defined Form panel Indicate which time picker to use for each panel, on forms with multiple time pickers. <input  type=time>   4 Conditional display User defined Dashboard panel Specify conditions for the display of panels and their contents based on the value of the token. Can be used with <drilldown> or <input> <condition>   5 Dynamic drilldown Predefined Dashboard panel Capture the value clicked for use in the drilldown. <drilldown>   6 Pan and zoom Predefined Dashboard panel Select a time range within a chart to zoom into. <selection>   Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 95. Advanced Dashboards & Visualizations Listen to your data™ 95 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Form Inputs •Seven types – Text box – Dropdown list – Radio button – Checkbox – Multi-selection – Time range picker – Submit •Add to a form or panel – Drag inputs onto panels •Free form input for multi-select and dropdown Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 96. Advanced Dashboards & Visualizations Listen to your data™ 96 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Form Inputs – Text Search that returns results to the table – variable part of search (the token) is surrounded by $’s Part of the search the user enters Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 97. Advanced Dashboards & Visualizations Listen to your data™ 97 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Form Inputs – Multi-select Search that returns results to table – the variable (token) is surrounded by $’s Part of the search the user selects Search that generates multiple select options Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 98. Advanced Dashboards & Visualizations Listen to your data™ 98 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Form Inputs – Checkbox Search that generates checkbox selections Part of the search the user selects Search that returns results to table – the variable (token) is surrounded by $’s Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 99. Advanced Dashboards & Visualizations Listen to your data™ 99 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Tokens – Cascading Inputs Use the selection of one form input to reduce or set the values of another form input Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 100. Advanced Dashboards & Visualizations Listen to your data™ 100 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Tokens – Link Switcher •Toggle dashboard content – Time range – Visualization – Search Time picker Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 101. Advanced Dashboards & Visualizations Listen to your data™ 101 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Core Drilldown •Allows for user interaction with view objects •Can dispatch a search on chart or table elements – Clicking an object redirects you to search view – Ctrl-clicking an object opens search in new window Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 102. Advanced Dashboards & Visualizations Listen to your data™ 102 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Ultra Drilldown •Provides drilldown options without hidden modifier keys •Click on an event to see a contextual pop-up menu – Add to search – Exclude from search – Create a search Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 103. Advanced Dashboards & Visualizations Listen to your data™ 103 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Dynamic Drilldown •Pass a value to another panel, form, dashboard or external site from: – Chart – Map – Table row or field – Multiple table fields •Use hidden fields in tables – Referenced only in drilldown links Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 104. Advanced Dashboards & Visualizations Listen to your data™ 104 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Dynamic Drilldown – Chart Dashboard: use $click.value$ to pass a value from a chart click token field destination value target view path Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 105. Advanced Dashboards & Visualizations Listen to your data™ 105 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Dynamic Drilldown – Table Row Dashboard: use $row.fieldname$ to pass a value from row click token field destination value target view path Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 106. Advanced Dashboards & Visualizations Listen to your data™ 106 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Dynamic Drilldown – Table Field Dashboard: use the field=name option to pass a value from a field click field=name option Same syntax as table row Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 107. Advanced Dashboards & Visualizations Listen to your data™ 107 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Dynamic Drilldown – Destination Form Add the token field to the search string to receive the value in the form view replacement token Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 108. Advanced Dashboards & Visualizations Listen to your data™ 108 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Dynamic Drilldown – Multiple Table Fields Dashboard: use field=name with multiple link tags to make multiple fields clickable Same syntax as: - table row - table field Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 109. Advanced Dashboards & Visualizations Listen to your data™ 109 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Dynamic Drilldown – Multiple Table Fields (cont.) Destination Form: Make sure you indicate default values for all token fields Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 110. Advanced Dashboards & Visualizations Listen to your data™ 110 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Dynamic Drilldowns – dest_value Indicates the value to capture from a table or chart dest_value Description Notes click.name click.name2 Passes the name of the field that is clicked on. • click.name: The value in a table column of the field that is clicked. • click.name2: The value in a table row of the field that is clicked. • Use with tables. click.value click.value2 Passes the value of the field that is clicked on. • click.value: The value in a table column of the field that is clicked. • click.value2: The value in a table row of the field that is clicked. • Use with all charts, except bar charts. For bar charts, these values are reversed. • Multivalue fields in a table use click.value2. earliest latest Passes the earliest and latest times of a search. • Use as parameters to URL for the target view. • For example, add: &earliest=$earliest$&latest=$latest$ to the drilldown target view URL. In this example, use CDATA to escape the '&’. form.token Passes the token accepted as input by the target form. • Use as a parameter to URL for the target form. row.fieldname Passes the value of the field named, for the entire row. • Specifies the field from the selected row or column from which to capture the value. • Use with tables. Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 111. Advanced Dashboards & Visualizations Listen to your data™ 111 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Event Handlers •Event handlers "listen" for specific events to occur, then perform an event action: – Set or unset tokens – Execute an eval function – Link to a page •Three types of event handlers: – Form inputs – Searches – Visualizations Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 112. Advanced Dashboards & Visualizations Listen to your data™ 112 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Event Action Syntax •Set or unset tokens <set  token="myToken">$text$</set>   <unset  token="myToken">$text$</unset>   •Execute an eval function <eval  token="myToken">tostring(round('field'))</eval>   •Link to a page <link>/app/myApp/my_form?form.token=$text$</link>   Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 113. Advanced Dashboards & Visualizations Listen to your data™ 113 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Form Input Event Handler •Use the <change> element to capture the label or value from an input and perform event actions with them •Applies to these inputs: – checkbox – dropdown – link – multiselect – radio – text Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 114. Advanced Dashboards & Visualizations Listen to your data™ 114 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Form Input Event Handler – Example Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 115. Advanced Dashboards & Visualizations Listen to your data™ 115 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Search Event Handler •Use predefined tokens to access search results or properties and perform event actions with them •Predefined tokens include: – results.field: access the value of the named field – job.property: access the value of the named search job property See the Knowledge Manager Manual for a complete list of search job properties. Note Search Event Description <cancelled> Execute actions when a search is cancelled. <done> Execute actions based on done search events. <error> Execute actions when there is an error in the search. <finalized> Execute an action when a search finalizes and data is available <progress> • Execute an action on search progress events. • Similar to the preview event handler. • Access job properties and field results. The progress event has only job properties information available. <preview> • Execute an action when search preview data is available. • Similar to the progress event handler. • Access job properties and field results. The preview event has only preview information available. Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 116. Advanced Dashboards & Visualizations Listen to your data™ 116 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Search Event Handler – Example Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 117. Advanced Dashboards & Visualizations Listen to your data™ 117 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Visualization Event Handler •Use the drilldown or selection elements to perform event actions – Available for: chart, event, map, single, or table •<selection>     – Sets the time window for the pan and zoom feature of charts – Use tokens to set other values, such as the numerical values of a chart's x-axis •<drilldown>   – Enable event actions for drilldown behaviors Selection element applies only to area, column, or line charts. Note Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 118. Advanced Dashboards & Visualizations Listen to your data™ 118 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Visualization Event Handler – Example •Pan & Zoom Example: Use <selection> in chart 1 to pick a time range for chart 2 Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 119. Advanced Dashboards & Visualizations Listen to your data™ 119 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 condition Element •Use with event handlers to specify the scope of event actions •Define complex conditional matching, token filtering and formatting •Use tokens based on search metadata, results, and job information Attributes Name Type Default Description label text * Specifies the input <label> element to which the condition applies. '*' applies the condition to all input <label> elements. match eval expression — An eval expression that defines the conditions needed for actions to be executed. value text * Specifies the input <value> element to which the condition applies. '*' applies the condition to all input <value> elements. Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 120. Advanced Dashboards & Visualizations Listen to your data™ 120 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 condition Element – Input •Specify actions based on input choices The <condition> element is not available for multiselect inputs. Note Example: Use conditional inputs to select preset time ranges for a search. <condition  label="[text]>">     ..  actions  ...     </condition>   Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 121. Advanced Dashboards & Visualizations Listen to your data™ 121 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 condition Element – Search •Specify the scope of actions based on an eval expression <condition  match="[eval  expression]>">     ..  actions  ...     </condition>   Example: If zero results are returned, show the html panel. If the results = 0, set a token called foob. If there is a token called foob, show the html panel. Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 122. Advanced Dashboards & Visualizations Listen to your data™ 122 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 condition Element – Drilldown •Limits the scope of drilldown actions to clicks on specific fields and adds logic <condition  field="[text]>">     ..  actions  ...     </condition>   Example: In-page drilldown to hidden panel. Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 123. Advanced Dashboards & Visualizations Listen to your data™ 123 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Lab 4 – Add Interactivity Time: 30 - 35 minutes Tasks: – Create a form – Add cascading multiselect inputs – Add chart panels – Add a visualization event handler – Add a dynamic drilldown – Create a drilldown destination form Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 124. Advanced Dashboards & Visualizations Listen to your data™ 124 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Module 5: Customizing Dashboards Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 125. Advanced Dashboards & Visualizations Listen to your data™ 125 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Module Objectives Upon successful completion of this module, you will be able to: •Use simple XMLextensions •Identify types of search managers •Link search managers to views •Explain how autodiscovery works •Add a D3 visualization to a dashboard Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 126. Advanced Dashboards & Visualizations Listen to your data™ 126 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Navigation •Once you've built reports and views, you can create navigation – Go to Settings > User interface > Navigation menus – Select the app context for your view – Edit the default file to specify the order and menus for your views nav menu bar color Default Navigation Bar 1 2 3 Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 127. Advanced Dashboards & Visualizations Listen to your data™ 127 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Navigation (cont.) Sub-menu with HTML pages renamed for this menu Views with file names that include "marketing" Searches with names that include "Top" All views not listed in default.xml Default view Nav bar color Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 128. Advanced Dashboards & Visualizations Listen to your data™ 128 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Simple XML Extensions •CSS and JavaScript extensions •Customize the look and behavior of an app by adding or modifying CSS & JS files in: $APP_HOME/appserver/static     and referencing them in the view:  <dashboard  stylesheet="my_style.css"    script="my_script.js">   •Customize dashboards and panels – For all, use: dashboard.css or dashboard.js – For individual: my_style.css or my_script.js   Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 129. Advanced Dashboards & Visualizations Listen to your data™ 129 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Simple XML Extensions (cont.) •Six extension points are provided: – Drilldown: customize the drilldown event for tables, charts, and other elements – Visualization: integrate a custom visualization as a panel – Layout: make simple layout changes – Stylesheet: use a custom CSS – Table Cell Renderer: custom styles and behaviors within table cells – Token Setting: set custom tokens for a dashboard page With simple XML extensions, you can still use the visual editor and PDF generation is available. Note Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 130. Advanced Dashboards & Visualizations Listen to your data™ 130 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Extension Points – Drilldown table_drilldown_url_field.js Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 131. Advanced Dashboards & Visualizations Listen to your data™ 131 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Extension Points – Visualization parallelcoords.js Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 132. Advanced Dashboards & Visualizations Listen to your data™ 132 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Extension Points – Layout custom_layout_overlay_single.css Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 133. Advanced Dashboards & Visualizations Listen to your data™ 133 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Extension Points – Stylesheet custom_decorations.css Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 134. Advanced Dashboards & Visualizations Listen to your data™ 134 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Extension Points – Table Cell Renderer table_icons_inline.js table_decorations.css Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 135. Advanced Dashboards & Visualizations Listen to your data™ 135 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Extension Points – Tokens Use JavaScript to set tokens in panel titles, html panels, and for drilldown. set_app_token.js Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 136. Advanced Dashboards & Visualizations Listen to your data™ 136 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Linking Searches & Views •Search ID for search •Link the search to the view with the search ID •Reference the path and JavaScript file Search 1 3 1 2 3 2 View Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 137. Advanced Dashboards & Visualizations Listen to your data™ 137 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Linking Reports & Views •Search ID for a report (saved search) •Link the report to the view with the search ID •Reference the path and JavaScript file 1 3 1 2 2 Report 3 View There is an assumed path that includes: /appserver/static/ For example, "app/sales/appserver/static/ Important Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 138. Advanced Dashboards & Visualizations Listen to your data™ 138 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Linking Global Searches & Views •Search ID for a global search •Post process •Link the post process to the view with the search ID 1 2 3 2 1 3 Post process View Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 139. Advanced Dashboards & Visualizations Listen to your data™ 139 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Troubleshooting •Verify the manager id matches the search manager id •Verify the path of data-­‐require – app/<app_name>/path/to/<js_file_without_extension>   •Verify all XMLattributes are properly escaped – Escape all special characters in the search query: ' < > " •Verify any tokens with values that contain the $ character are escaped by using two dollar signs: $$token$$   •Verify the value of data-options is a valid JavaScript object – Comma and quote placements •Look for any JavaScript errors in the browser Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 140. Advanced Dashboards & Visualizations Listen to your data™ 140 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 SimpleSplunkView.js •Extend this base class to create custom views •Several methods that you can override as needed: – initialize: the constructor – formatData: formats results data from Splunk and returns a handle to the data – formatResults: same as formatData, except you can format the full set of data from the results model – createView: configures the custom visualization and returns a handle to it – updateView: puts Splunk data into the view – clearView: resets rendering – render: creates the initial view and draws it on the screen. On subsequent calls, runs a full update cycle by calling formatResults, formatData, then updateView   Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 141. Advanced Dashboards & Visualizations Listen to your data™ 141 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Example – tagcloud.js •Load dependencies – Underscore and jquery libraries – SimpleSplunkView base class – any optional SplunkJS libraries and stylesheets •Declare a new class (inheriting from SimpleSplunkView base class) and its options •Define any events – Here, drilldown when clicking a tag •Re-render the view when the settings change 1 1 2 3 2 3 4 4 Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 142. Advanced Dashboards & Visualizations Listen to your data™ 142 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Example – tagcloud.js (cont.) •When the search runs, update the view – Clear the current view – Extract and convert the magnitude field value – Find the maximum and minimum of the magnitude values – Calculate relative size of each tag and render 5 5 Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 143. Advanced Dashboards & Visualizations Listen to your data™ 143 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 autodiscover.js •Re-use custom components, especially visualizations, in multiple dashboards and apps •It looks for splunk-­‐view or class elements in your embedded JavaScript •The splunkjs/ready script must be loaded to perform auto-discovery autodiscover.js splunkjs/ready! script should not be loaded before dashboard renders. Ensure this by loading it within a splunkjs/mvc/simplexml/ready! loader script callback. Note Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 144. Advanced Dashboards & Visualizations Listen to your data™ 144 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 autodiscover.js (cont.) •Two methods to enable auto-discover: – Use a dedicated JavaScript file in the appserver/static directory and load the code from the dashboard using the custom script attribute – Include the code in dashboard.js ê This loads automatically for every simple XML dashboard within the app ê With this method, auto-discovery works for all dashboards without specifically enabling it Dedicated JS file referenced in XML Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 145. Advanced Dashboards & Visualizations Listen to your data™ 145 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 HTML Conversion •To work in HTML& JavaScript, you can easily convert simple XMLviews – Then, add CSS, change the layout, edit the JavaScript to add interactivity, etc. Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 146. Advanced Dashboards & Visualizations Listen to your data™ 146 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 HTML Conversion (cont.) •Layout is converted into Splunk styles •Elements and forms are converted to SplunkJS Stack equivalents •Definition of each element and form is converted into JavaScript – Properties – Auto-generated ID •All searches are extracted and represented in SplunkJS Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 147. Advanced Dashboards & Visualizations Listen to your data™ 147 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Lab 5 – Add Advanced Visualizations Time: 25 - 30 minutes Tasks: – Create a dashboard – Add simple xml extensions – Add an HTMLpanel – Add a search id – Add search manager and visualization Challenge Tasks: – Add a D3 visualization – Customize multiselect inputs Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 148. Advanced Dashboards & Visualizations Listen to your data™ 148 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Summary Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 149. Advanced Dashboards & Visualizations Listen to your data™ 149 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Wrap-up You should now be able to: •Generate, format, and customize charts •Create dashboards and forms that use: – dynamic drilldowns – post process searches – tokens •Use JavaScript and CSS to create customize visualizations Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 150. Advanced Dashboards & Visualizations Listen to your data™ 150 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Wrap-up You should now be able to: •Use best practices for planning and creating views •Define data structure requirements for visualizations •Create efficient, well-formed searches that generate charts •Edit simple xml to enable: – dynamic drilldowns – global searches – tokens •Use JavaScript and CSS to create interactive visualizations •Troubleshoot views Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 151. Advanced Dashboards & Visualizations Listen to your data™ 151 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Next Steps Apps •Splunk Dashboard Examples •Common Information Model Courses •Advanced Search & Reporting •Building SplunkApps •Splunk 6Administration License •Developer Trial License Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 152. Advanced Dashboards & Visualizations Listen to your data™ 152 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 Support Programs • Community – SplunkAnswers:answers.splunk.com – SplunkDev:dev.splunk.com – SplunkDocs:docs.splunk.com – Wiki:wiki.splunk.com – IRC Channel: #splunk on the EFNet IRC server • Global Support Supportforcriticalissues,adedicatedresourcetomanageyouraccount–24x7x365. – Email:[email protected] – Web:http://www.splunk.com/index.php/submit_issue • Enterprise Support – Access customer support by phone and manage your cases online 24 x 7 (depending on support contract). Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution
  • 153. Advanced Dashboards & Visualizations Listen to your data™ 153 Copyright © 2015 Splunk, Inc. All rights reserved. | 6 November 2015 • Complete the survey to be in this month's drawing for a $100 Splunk Store voucher – Checkyourinboxforalinktothesurvey,oraccessthelinkontheMyProfilepage Thank You Generated for Marco Tavares ([email protected]) (C) Splunk Inc, not for distribution