falcosidekick: CustomFields keys cannot contain a dot

Describe the bug

The customfields keys cannot contain a dot or the Umarshalling fails:

customfields:
  A.key: "AValue"
2022/06/16 13:52:55 [ERROR] : Error unmarshalling config : 1 error(s) decoding:

* 'Customfields[a]' expected type 'string', got unconvertible type 'map[string]interface {}'

How to reproduce it

See example ⬆️

Expected behaviour

Be able to use . in keys

Screenshots

N/A

Environment

  • Falco version: All versions are concerned on all systems

Additional context

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 18 (4 by maintainers)

Most upvoted comments

Hi, thank you for your help. I tested same solution with defaultKeyDelimiter, I agree it works, with values from yaml file, but it breaks with settings from env vars, it’s annoying. This is why I created this issue, to keep it in the Todo as the fix is not so trivial after all

Hello, I have been working with Falcosidekick for a few months now, and I have decided to contribute. I looked a bit into the issue of using keys containing the key delimiter ., following both issue and PR from viper. It seems that the only supported option for allowing . is to modify defaultKeyDelimiter to a non-accepted character by YAML (the best choice \). I did some tests in my dev environment, and it seems to work well.