-
Transforming your data: the real fun begins!
-
- Now that you've mastered the basics, it's time to unleash the power of
- Timelion. Let's figure out what percentage some subset of our data
- represents of the whole, over time. For example, what percentage of
- our web traffic comes from the US?
-
+
+
+
+
+
+
- First, we need to find all events that contain US:
- .es('US').
-
-
- Next, we want to calculate the ratio of US events to the whole. To
- divide 'US' by everything, we can use the
- divide function: .es('US').divide(.es()).
-
-
- Not bad, but this gives us a number between 0 and 1. To convert it
- to a percentage, simply multiply by 100:
- .es('US').divide(.es()).multiply(100).
-
-
- Now we know what percentage of our traffic comes from the US, and
- can see how it has changed over time!
- Timelion has a number of built-in arithmetic functions, such as
- sum, subtract, multiply, and
- divide. Many of these can take a series or a number.
- There are also other useful data transformation functions, such as
- movingaverage, abs, and
- derivative.
-
-
Now that you're familiar with the syntax, refer to the
- Function reference to see
- how to use all of the available Timelion functions. You can view
- the reference at any time by clicking Docs
- in the Kibana toolbar. To get back to this tutorial, click the
- Tutorial link at the top of the reference.
+
+
+