Rows to fields transform
Note: This is a new beta transformation introduced in v8.1.
This transforms rows into separate fields. This can be useful as fields can be styled and configured individually, something rows cannot. It can also use additional fields as sources for dynamic field configuration or map them to field labels. The additional labels can then be used to define better display names for the resulting fields.
Useful when visualizing data in:
- Pie chart
If you want to extract config from one query and appply it to another you should use the Config from query results transformation instead.
|ServerA (config: max=100)||ServerB (config: max=200)||ServerC (config: max=300)|
As you can see each row in the source data becomes a separate field. Each field now also has a max config option set. Options like Min, Max, Unit and Thresholds are all part of field configuration and if set like this will be used by the visualization instead of any options manually configured in the panel editor options pane.
To do this transformation Grafana needs to know how to use each field in the input data. The UI options for this transform shows you all fields and Use as option to tell Grafana how to use the field.
The name field (required)
This transformation needs one field to use as the source of field names. By default the transform will use the first string field for this. But you can override this default behavior by selecting Field name in the Use as column for the field you want to use instead.
The value field (required)
This transformation needs one field to use as the source of values. By default the transform will use the first number field for this. But you can override this default behavior by selecting Field value in the Use as column for the field you want to use instead.
Map extra fields to config
You can map extra fields to configuration like min, max, unit and threshold. If the field name maps directly to one of these config fields Grafana will handle this mapping automatically.
Map extra fields to labels
If a field does not map to config property Grafana will automatically use it as source for a label on the output field-
|ServerA (labels: DataCenter: US)||ServerB (labels: DataCenter: EU)|
The extra labels can now be used in the field display name provide more complete field names.
Related Grafana resources
Unify your data with Grafana plugins: Splunk, MongoDB, Datadog, and more
Show how Grafana can be used to take data from multiple different sources and unify it, without disrupting the investments that are working today.
Demo: Getting started with Grafana Enterprise and observability
Join the Grafana Labs team for a 30-minute demo of how to get started with the Grafana Stack, so you can go from zero to observability in just a few minutes.