In today’s article, we’ll use Timelion to draw in real time on a canvas. I’m going to show this as Elastic Stack 7.10.

How do I use Timelion drawing in canvas

 

To prepare data

We will use the index that comes with Kibana. Open Kibana:

Now we import the index KibanA_SAMPLE_datA_logs into Elasticsearch.

 

Draw using timelion in canvas

Open the Canvas application:

Let’s copy the following code into the following editor:

filters
| timefilter from="now-10d" to="now"
| timelion
  query=".es(index=kibana_sample_data_logs,q=geo.dest:CN, metric=avg:bytes).color(blue).label(\"CN\"),  .es(index=kibana_sample_data_logs,q=geo.dest:US, metric=avg:bytes).color(red).label(\"US\")"
| pointseries x="@timestamp" y="value" color="label"
| plot defaultStyle={seriesStyle lines=3 points="0"}
  palette={palette "#1ea593" "#2b70f7" "#ce0060" "#38007e" "#fca5d3" "#f37020" "#e49e29" "#b0916f" "#7b000b" "34130c" gradient=false } xaxis=false
| render
Copy the code

Above, we draw the sequence diagrams of two Timelions. If you are not familiar with Timelion, please refer to my previous article “Time Series Analysis with Kibana Timelion”. Click the Run button above:

We can see two different time series graphs representing the average traffic to the United States (US) and China (CN) destinations.