This topic describes how to configure a sankey diagram to display query results.
The sankey diagram is a specific type of flow chart. It shows the flow from one set
of values to another set of values. Sankey diagrams are applicable to scenarios such
as network traffic flows. A sankey diagram contains values of three fields:
target fields describe the source and target nodes, and the
value field describes the flows from the
source node to the
- The start flow is equal to the end flow. The overall width of all main edges is equal to the total sum of all branch edges. This allows you to manage and maintain a balanced flow of all traffic.
- The edge width in a row represents the traffic distribution in a specific status. The edge width in a row represents the distribution of traffic.
- The width of an edge between two nodes represents the flow volume in a status.
- Log on to the Log Service console.
- In the Projects section, click the name of the project that you want to manage.
- Choose , and then click the Logstore that you want to manage.
- Enter a query statement in the search box, specify a time range, and then click Search & Analyze.
- Click to display the query results in a sankey diagram.
- On the Properties tab, configure the properties of the sankey diagram.
Parameter Description Start Column The start node. End Column The end node. Value Column The value of traffic between the start node and end node. Margin The distance of the axis to the borders of the chart. This includes the Top Margin, Bottom Margin, Right Margin, and Left Margin.
Example of a simple sankey diagram
valuefields, you can execute a Nested subquery statement to obtain the total sum of all
* | select sourceValue, targetValue, sum(streamValue) as streamValue from (select sourceValue, targetValue, streamValue, __time__ from log group by sourceValue, targetValue, streamValue, __time__ order by __time__ desc) group by sourceValue, targetValue
Example of a sankey diagram for layer-7 access logs of Server Load Balance (SLB)
Log Service allows you to display query results of Usage notes in a sankey diagram.
* | select COALESCE(client_ip, slbid, host) as source, COALESCE(host, slbid, client_ip) as dest, sum(request_length) as inflow group by grouping sets( (client_ip, slbid), (slbid, host))