vectordotdev / helm-charts

Helm charts for Vector.
https://vector.dev
Mozilla Public License 2.0
103 stars 89 forks source link

map_keys stopped working in the latest helm chart 0.21 #295

Closed oleksiiprokhorenko closed 1 year ago

oleksiiprokhorenko commented 1 year ago

Hello,

This part of code worked fine on the previous versions:

  de_dots:
      type: remap
    inputs:
    - s3_k8s_logs
    source: |
      . = parse_json!(.message)
      . = map_keys(., recursive: true) -> |key| { replace(key, ".", "_") }

But on the latest helm chart it shows the following error:

2023-04-14T11:12:24.894946Z ERROR vector::topology: Configuration error. error=Transform "de_dots": error[E121]: type mismatch in closure parameter ┌─ :1:1 │ 1 │ . = mapkeys(., recursive: true) -> |key| { replace(key, ".", "") } │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ │ │ │ the closure tied to this function call expects a different input value │ expression has an inferred type of string, integer, float, boolean, null, array or object where an array or object was expected │ = see language documentation at https://vrl.dev = try your code in the VRL REPL, learn more at https://vrl.dev/examples

Any suggestions would be appreciated.