0

consider having the following line protocol data:

my_measurement,foo="Some" bar="Thing",baz=123

where foo is a tag and bar and baz are fields, I need to get, say, a string "Some|Thing" out of InfluxDB OSS v2 using the Flux language. What's the trick? How to do it? There is the strings.joinStr() and the keyValues() functions I feel could be perhaps used to get the desired values but I failed to do so.

mjf
  • 498
  • 4
  • 15

1 Answers1

1

You can do this with map(), for example:

|> map(fn: (r) => ({r with newColName: r.foo+r._bar}))

Or, if you have to convert the type of _field,

|> map(fn: (r) => ({r with newColName: r.foo+string(v: r._baz)}))
FractalDoctor
  • 2,496
  • 23
  • 32