mirror of
https://github.com/grafana/grafana.git
synced 2024-11-22 00:47:38 -06:00
Docs/Transformations: Add documentation about Binary operations in Add field from calculation (#29511)
* Add also infor about binary operations * Update docs/sources/panels/transformations/types-options.md Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> * Update docs/sources/panels/transformations/types-options.md Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> * Update docs/sources/panels/transformations/types-options.md Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
This commit is contained in:
parent
53cd59a5a5
commit
eb16eb5d72
@ -7,17 +7,17 @@ weight = 300
|
||||
|
||||
Grafana comes with the following transformations:
|
||||
|
||||
- [Reduce](#reduce)
|
||||
- [Filter by name](#filter-by-name)
|
||||
- [Filter data by query](#filter-data-by-query)
|
||||
- [Filter data by value](#filter-data-by-value)
|
||||
- [Organize fields](#organize-fields)
|
||||
- [Outer join](#join-by-field-outer-join)
|
||||
- [Series to rows](#series-to-rows)
|
||||
- [Add field from calculation](#add-field-from-calculation)
|
||||
- [Labels to fields](#labels-to-fields)
|
||||
- [Group by](#group-by)
|
||||
- [Merge](#merge)
|
||||
- [Reduce](#reduce)
|
||||
- [Filter by name](#filter-by-name)
|
||||
- [Filter data by query](#filter-data-by-query)
|
||||
- [Filter data by value](#filter-data-by-value)
|
||||
- [Organize fields](#organize-fields)
|
||||
- [Outer join](#join-by-field-outer-join)
|
||||
- [Series to rows](#series-to-rows)
|
||||
- [Add field from calculation](#add-field-from-calculation)
|
||||
- [Labels to fields](#labels-to-fields)
|
||||
- [Group by](#group-by)
|
||||
- [Merge](#merge)
|
||||
|
||||
Keep reading for detailed descriptions of each type of transformation and the options available for each, as well as suggestions on how to use them.
|
||||
|
||||
@ -139,7 +139,8 @@ Use this transformation to add a new field calculated from two other fields. Eac
|
||||
- **Reduce row -** Apply selected calculation on each row of selected fields independently.
|
||||
- **Binary option -** Apply basic math operation(sum, multiply, etc) on values in a single row from two selected fields.
|
||||
- **Field name -** Select the names of fields you want to use in the calculation for the new field.
|
||||
- **Calculation -** Select a calculation to use when Grafana creates the new field. Click in the field to see a list of calculation choices. For information about available calculations, refer to the [Calculation list]({{< relref "../calculations-list.md" >}}).
|
||||
- **Calculation -** If you select **Reduce row** mode, then the **Calculation** field appears. Click in the field to see a list of calculation choices you can use to create the new field. For information about available calculations, refer to the [Calculation list]({{< relref "../calculations-list.md" >}}).
|
||||
- **Operation -** If you select **Binary option** mode, then the **Operation** fields appear. These fields allow you to do basic math operations on values in a single row from two selected fields. You can also use numerical values for binary operations.
|
||||
- **Alias -** (Optional) Enter the name of your new field. If you leave this blank, then the field will be named to match the calculation.
|
||||
- **Replace all fields -** (Optional) Select this option if you want to hide all other fields and display only your calculated field in the visualization.
|
||||
|
||||
@ -185,7 +186,7 @@ After I apply the transformation, my labels appear in the table as fields.
|
||||
|
||||
> **Note:** This transformation is only available in Grafana 7.2+.
|
||||
|
||||
This transformation groups the data by a specified field (column) value and processes calculations on each group. Click to see a list of calculation choices. For information about available calculations, refer to the [List of calculations]({{< relref "../calculations-list.md" >}}).
|
||||
This transformation groups the data by a specified field (column) value and processes calculations on each group. Click to see a list of calculation choices. For information about available calculations, refer to the [List of calculations]({{< relref "../calculations-list.md" >}}).
|
||||
|
||||
Here's an example of original data.
|
||||
|
||||
@ -203,17 +204,17 @@ Here's an example of original data.
|
||||
|
||||
This transformation goes in two steps. First you specify one or multiple fields to group the data by. This will group all the same values of those fields together, as if you sorted them. For instance if we group by the Server ID field, then it would group the data this way:
|
||||
|
||||
| Time | Server ID | CPU Temperature | Server Status |
|
||||
| ------------------- | ------------ | --------------- | ------------- |
|
||||
| 2020-07-07 11:34:20 | **server 1** | 80 | Shutdown |
|
||||
| 2020-07-07 09:28:06 | **server 1** | 80 | OK |
|
||||
| 2020-07-07 09:23:07 | **server 1** | 86 | OK |
|
||||
| 2020-07-07 10:32:20 | server 2 | 90 | Overload |
|
||||
| 2020-07-07 09:30:05 | server 2 | 88 | OK |
|
||||
| 2020-07-07 09:25:05 | server 2 | 88 | OK |
|
||||
| 2020-07-07 11:34:20 | **_server 3_** | 62 | OK |
|
||||
| 2020-07-07 10:31:22 | **_server 3_** | 55 | OK |
|
||||
| 2020-07-07 09:30:57 | **_server 3_** | 62 | Rebooting |
|
||||
| Time | Server ID | CPU Temperature | Server Status |
|
||||
| ------------------- | -------------- | --------------- | ------------- |
|
||||
| 2020-07-07 11:34:20 | **server 1** | 80 | Shutdown |
|
||||
| 2020-07-07 09:28:06 | **server 1** | 80 | OK |
|
||||
| 2020-07-07 09:23:07 | **server 1** | 86 | OK |
|
||||
| 2020-07-07 10:32:20 | server 2 | 90 | Overload |
|
||||
| 2020-07-07 09:30:05 | server 2 | 88 | OK |
|
||||
| 2020-07-07 09:25:05 | server 2 | 88 | OK |
|
||||
| 2020-07-07 11:34:20 | **_server 3_** | 62 | OK |
|
||||
| 2020-07-07 10:31:22 | **_server 3_** | 55 | OK |
|
||||
| 2020-07-07 09:30:57 | **_server 3_** | 62 | Rebooting |
|
||||
|
||||
All rows with the same value of Server ID are grouped together.
|
||||
|
||||
@ -245,7 +246,7 @@ This transformation allows you to extract some key information out of your time
|
||||
|
||||
> **Note:** This transformation is only available in Grafana 7.1+.
|
||||
|
||||
Use this transformation to combine the result from multiple time series data queries into one single result. This is helpful when using the table panel visualization.
|
||||
Use this transformation to combine the result from multiple time series data queries into one single result. This is helpful when using the table panel visualization.
|
||||
|
||||
The result from this transformation will contain three columns: Time, Metric, and Value. The Metric column is added so you easily can see from which query the metric originates from. Customize this value by defining Label on the source query.
|
||||
|
||||
@ -280,7 +281,6 @@ Here is the result after applying the Series to rows transformation.
|
||||
|
||||
## Filter by value
|
||||
|
||||
|
||||
This transformation allows you to filter your data directly in Grafana and remove some data points from your query result. You have the option to include or exclude data that match one or more conditions you define. The conditions are applied on a selected field.
|
||||
|
||||
The available conditions are:
|
||||
@ -300,15 +300,15 @@ The available conditions are:
|
||||
|
||||
Consider the following data set:
|
||||
|
||||
| Time | Temperature | Altitude
|
||||
|---------------------|-------------|----------
|
||||
| 2020-07-07 11:34:23 | 32 | 101
|
||||
| 2020-07-07 11:34:22 | 28 | 125
|
||||
| 2020-07-07 11:34:21 | 26 | 110
|
||||
| 2020-07-07 11:34:20 | 23 | 98
|
||||
| 2020-07-07 10:32:24 | 31 | 95
|
||||
| 2020-07-07 10:31:22 | 20 | 85
|
||||
| 2020-07-07 09:30:57 | 19 | 101
|
||||
| Time | Temperature | Altitude |
|
||||
| ------------------- | ----------- | -------- |
|
||||
| 2020-07-07 11:34:23 | 32 | 101 |
|
||||
| 2020-07-07 11:34:22 | 28 | 125 |
|
||||
| 2020-07-07 11:34:21 | 26 | 110 |
|
||||
| 2020-07-07 11:34:20 | 23 | 98 |
|
||||
| 2020-07-07 10:32:24 | 31 | 95 |
|
||||
| 2020-07-07 10:31:22 | 20 | 85 |
|
||||
| 2020-07-07 09:30:57 | 19 | 101 |
|
||||
|
||||
If you **Include** the data points that have a temperature below 30°C, the configuration will look as follows:
|
||||
|
||||
@ -317,14 +317,13 @@ If you **Include** the data points that have a temperature below 30°C, the conf
|
||||
|
||||
And you will get the following result, where only the temperatures below 30°C are included:
|
||||
|
||||
|
||||
| Time | Temperature | Altitude
|
||||
|---------------------|-------------|----------
|
||||
| 2020-07-07 11:34:22 | 28 | 125
|
||||
| 2020-07-07 11:34:21 | 26 | 110
|
||||
| 2020-07-07 11:34:20 | 23 | 98
|
||||
| 2020-07-07 10:31:22 | 20 | 85
|
||||
| 2020-07-07 09:30:57 | 19 | 101
|
||||
| Time | Temperature | Altitude |
|
||||
| ------------------- | ----------- | -------- |
|
||||
| 2020-07-07 11:34:22 | 28 | 125 |
|
||||
| 2020-07-07 11:34:21 | 26 | 110 |
|
||||
| 2020-07-07 11:34:20 | 23 | 98 |
|
||||
| 2020-07-07 10:31:22 | 20 | 85 |
|
||||
| 2020-07-07 09:30:57 | 19 | 101 |
|
||||
|
||||
You can add more than one condition to the filter. For example, you might want to include the data only if the altitude is greater than 100. To do so, add that condition to the following configuration:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user