Copyright (C) 2019 Chris Younger. I am a Splunk Professional Services consultant working for JDS Australia, in Brisbane Australia.
This visualisation should work with any data that works with the Splunk built-in line chart. The first column (which is often "_time") will be the X-axis and subsequent columns will be rendered as lines (so they should be numeric values). A column with the specific name "regions" should be supplied which defines the regions to draw behind the chart.
This is how the data should look:
Regions are drawn per-column vertically, from bottom to top. Horizontal regions can be drawn by setting the same region value on multiple columns. See the examples below.
The format for the region field is comma-seperated key-value pairs and best explained with examples:
||The most basic example that creates a region. A red column of data will be drawn from the bottom of the chart to the top of chart. Region colors can be specificed as valid HTML colours (RBG, Hex, named colours, etc..).|
||Create a named region in a grey color for the chart column. This name will be seen on the tooltip when hovering the chart.|
||Create a green region from the bottom of the chart to 1000, an orange region from 1000 to 1500 and a red region from 1500 to the top of the chart.|
||Create a orange region from 1000 to 1500 and a red region from 1500 to the top of the chart.|
Especially useful for visualizing the adaptive thresholds that were set by ITSI (also works with ITSI static thresholds). Requires add-on Get ITSI Thresholds - custom command
index="itsi_summary" itsi_service_id=c2d8f443-fd65-4872-b3b8-1ac7757b57f6 kpiid=a672f70631ce28a0be31e1f2 indexed_is_service_max_severity_event=0 | timechart span=1h avg(alert_value) as alert_value | getitsithresholds service=c2d8f443-fd65-4872-b3b8-1ac7757b57f6 kpi=a672f70631ce28a0be31e1f2
Over a 24 hour chart, show the hours that are important.
... search ... | timechart span=1h avg(series1) as avg | eval hour = strftime(_time, "%H") | eval regions = if(hour > 17 OR hour < 9,"Out of hours=#009DD9","") | fields - hour
Hardcoded simple static thresholds.
... search ... | timechart span=1m avg(series1) as avg | eval regions = "normal=#99D18B,5000,Warning=#FCB64E,7000,Error=#B50101"
Add a gray region to highlight the area of the chart that is less than 15 minutes old. Can easily be adapted to show a maintinance window.
... search ... | timechart span=1h avg(series1) as avg | eval regions = if(_time > (now() - 900),"Data still arriving=#aaaaaa","")
Calculate the historical average and standard deviation of the data. Then mark regions based on the standard deviations.
... search over 2 weeks of data ... | timechart span=1h avg(FIELD) as avg stdev(FIELD) as stddev | timewrap w series=short align=now | where _time > now() - 86400 | eval regions = "3 standard deviations below=#B50101," + tostring(avg_s1 - stddev_s1 * 3) + ",2 standard deviations below=#FCB64E," + tostring(avg_s1 - stddev_s1 * 2) + ",normal=#99D18B," + tostring(avg_s1 + stddev_s1 * 2) + ",2 standard deviations above=#FCB64E," + tostring(avg_s1 + stddev_s1 * 3) + ",3 standard deviations above=#B50101" | table _time avg_s0 avg_s1 regions
There are two modes of rendering the lines when there are multiple series of data. "Lighter/Dashed" is best suited when the data series are historical trend lines. E.g. Comparing CPU performance this week against last week and the week before. "Coloured" is best suited when the data series are peers. E.g. The average CPU of three servers in a cluster.
There are some text overlays that can be enabled. Note that these overlays are only for the primary data series.
The following third-party libraries are used by this app. Thank you!
jQuery - MIT - https://jquery.com/
D3 - BSD 3-Clause - https://d3js.org/
TinyColor - MIT - https://github.com/bgrins/TinyColor
Font Awesome - Creative Commons Attribution-ShareAlike 4.0 License - https://fontawesome.com/
Splunk AppInspect evaluates Splunk apps against a set of Splunk-defined criteria to assess the validity and security of an app package and components.
As a Splunkbase app developer, you will have access to all Splunk development resources and receive a 10GB license to build an app that will help solve use cases for customers all over the world. Splunkbase has 1000+ apps and add-ons from Splunk, our partners and our community. Find an app or add-on for most any data source and user need, or simply create your own with help from our developer portal.