Adding column based on values

Hello

  • What Grafana version and what operating system are you using?
    11.2

  • What are you trying to achieve?
    Adding column to existing table based on values

**Datasoruce
InfluxDB1.8

My goal is to add (using tranformation i guess) column with command which will have combination of text and values , so as on example I wanna have for example
echo $valueCurrentVP.value changestuff --cpu=$entitledPU.value

welcome @marcinramzesmichalow

what is your data source?

Hi,
Data source is influxdb1.8 (there is couple of queries) merged using data transform.
I have tried to use Add field from calculation , non of option support mixing text and values.

influxql or flux query language?

Hi,

InfluxQL

Using flux it can be easily implemented via map function, but don’t think it’s possible to achieve using InfluxQL or Grafana transformations.

You can add echo prefix to your existing column, although it also won’t probably solve your task:

Hi, thx :slight_smile: I was afraid there is no simple (or any) solution. I have tried so many different ways.
I had no idea actually its source dependent.

Prefix will not solve as I want to make more complicated comand in out based on values from different columns something like

change -d $value1 --add $value2 --config $value3 bla bla

where $value* are from each column.

Grafana is great for visualization, but such type of transformation is better to be done at the datasource side.

For InfluxDB, Flux would definitely sort it out, but InfuxQL unfortunately is not so powerful and flexible…

2 Likes