For additional information, visit dataflect.com.
Render a Sankey diagram from any search that outputs exactly three columns:
- source (string)
- target (string)
- value (numeric)
The visualization aggregates results across pages automatically, but you should aggregate in SPL for best performance.
Your final pipeline must end with a table like:
source | target | value |
---|---|---|
A | B | 10 |
A | C | 5 |
B | D | 7 |
Notes:
- value
must be numeric (use tonumber()
if needed).
- If your field names differ, rename
them to source
, target
, value
.
| makeresults
| eval flows="S1>A 10;S1>B 5;S2>A 3;S2>C 7;S3>B 8;A>X 9;A>Y 4;B>X 6;B>Y 5;C>Y 7;X>Z1 8;X>Z2 7;Y>Z2 9;Y>Z3 6"
| makemv delim=";" flows
| mvexpand flows
| rex field=flows "(?<source>[^> ]+)\s*>\s*(?<target>[^ ]+)\s+(?<value>\d+)"
| eval value=tonumber(value)
| table source target value
<your base search producing src, dst, count>
| stats sum(count) as value by src dst
| rename src as source dst as target
| where value > 0
| table source target value
Tip: Use By source or By target to emphasize fan-out vs. fan-in relationships. Use Gradient to show flow transitions.
Tip: Switch between Left, Center, Right, and Justify on datasets with multiple interior layers to see distinct layouts.
Always aggregate before the final table
:
... | stats sum(value) as value by source target | where value > 0
Ensure the graph is acyclic; Sankey represents directional flow between columns.
(source, target)
pairs to a reasonable size for interactivity.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 from Splunk, our partners and our community. Find an app for most any data source and user need, or simply create your own with help from our developer portal.