Transformations: support a rows mode in labels to fields (#41020)
This commit is contained in:
@@ -192,20 +192,33 @@ In the example below, I added two fields together and named them Sum.
|
||||
|
||||
## Labels to fields
|
||||
|
||||
This transformation changes time series results that include labels or tags into to a table structure where each label becomes its own field.
|
||||
This transformation changes time series results that include labels or tags into to a table structure where each label keys and values
|
||||
are included in the table result. The labels can be displayed either as columns or as row values.
|
||||
|
||||
Given a query result of two time series:
|
||||
|
||||
- Series 1: labels Server=Server A, Datacenter=EU
|
||||
- Series 2: labels Server=Server B, Datacenter=EU
|
||||
|
||||
This would result in a table like this:
|
||||
In "Columns" mode, the result looks like this:
|
||||
|
||||
| Time | Server | Datacenter | Value |
|
||||
| ------------------- | -------- | ---------- | ----- |
|
||||
| 2020-07-07 11:34:20 | Server A | EU | 1 |
|
||||
| 2020-07-07 11:34:20 | Server B | EU | 2 |
|
||||
|
||||
In "Rows" mode, the result has a table for each series and show each label value like this:
|
||||
|
||||
| label | value |
|
||||
| ---------- | -------- |
|
||||
| Server | Server A |
|
||||
| Datacenter | EU |
|
||||
|
||||
| label | value |
|
||||
| ---------- | -------- |
|
||||
| Server | Server B |
|
||||
| Datacenter | EU |
|
||||
|
||||
### Value field name
|
||||
|
||||
If you selected Server as the **Value field name**, then you would get one field for every value of the Server label.
|
||||
|
||||
Reference in New Issue
Block a user