On This Page

Home / Search/ Visualize/ Charts/ Chart Types/Sankey Diagram

Sankey Diagram ​

Show how a value flows between categories.


Use a Sankey diagram to follow a quantity from its sources to its destinations, such as bytes sent between source and destination addresses. The width of each link shows how much flows along it.

A Sankey diagram needs two category fields and a numeric field in the results. Time fields don’t count as category fields. If the results don’t meet these requirements, Sankey is unavailable in the Type field.

Cribl Search doesn’t recommend Sankey automatically, so select it in the Type field.

The following search uses the cribl_search_sample Dataset to total the bytes sent between each pair of addresses. Each result row describes one flow between two addresses, which the diagram draws as a link:

dataset="cribl_search_sample" datatype="aws_vpcflow"
| where isnotnull(srcaddr) and isnotnull(dstaddr) and isnotnull(bytes)
| summarize bytes=sum(bytes) by srcaddr, dstaddr
| sort by bytes desc
| limit 10

Data ​

Cribl Search fills in these fields from the results. Source and Target start as the first two category fields, and Value starts as the first numeric field. You can change any of them.

Source: Select the field that names the node each flow starts from.

Target: Select the field that names the node each flow ends at.

Value: Select the numeric field that sets the width of each link.

Cribl Search builds the diagram from the values in Source and Target. The same text in both fields is one node, so a node can receive links from one node and send links to another.

If several rows share the same source and target, the diagram draws one link with the Value from the first of those rows. The diagram doesn’t add those values together. To total them, use summarize before you chart the results.

A Value that isn’t a number counts as 0.

Display ​

Values colors: Select the color scheme for the nodes. The Cribl brand palette is the default.

Orientation: Select Horizontal, Vertical, or Radial. Horizontal is the default. Radial draws the flows around a circle as a chord diagram. The Type field also lists the Radial layout as Chord.

Label position: Select where each node label appears, or select Hidden to remove the labels. The choices depend on Orientation:

  • Horizontal: Select Right, Left, or Inside. Right is the default.
  • Vertical: Select Top, Bottom, or Inside. Top is the default.
  • Radial: Select Top or Inside. Top is the default.

If you change Orientation and the current label position isn’t available in the new layout, Cribl Search switches to the default for that layout. Hidden stays selected.

Link color: Select how each link is colored. Gradient is the default and blends from the color of the source node to the color of the target node. Source and Target give each link the color of its source node or its target node.

Node label format (shown when Source or Target is a string field): Set how node names are cut and formatted.

Legend ​

Only a Radial layout has a legend. The legend lists the nodes, and you can select a node there to hide or show it.

Position: Select Top, Bottom, Left, or Right.

Label format: Set how the legend text is cut and formatted.

Hide the legend to remove it from the chart.

Tooltip ​

The tooltip shows the name and value of a node, or the source, target, and value of a link. The value uses the format of the Value field.

Additional fields: Select extra result fields for the tooltip.

Hide the tooltip to leave it off the chart.

Additional fields apply only to links. A link shows them from its first row. The list doesn’t offer the Source, Target, and Value fields.

Circular Flows ​

A flow that starts and ends at the same node is a self-loop. A circular flow leads back to where it started, such as from A to B and back to A. Orientation decides how the diagram handles both:

  • Horizontal and Vertical: The diagram leaves out self-loops. If every row is a self-loop, or the remaining flows still form a circle, the panel explains the problem instead of drawing a chart.
  • Radial: The diagram draws self-loops and circular flows.

Interactions ​

In a Dashboard, select a node to run the Interaction you configured. The Interaction can use the following tokens:

  • $value$ and $field.value$ are the name of the node.
  • $field.name$ is the name of the field that the node came from, either Source or Target.

A node combines several rows, so $rowData.<fieldname>$ isn’t available.