Hi - Im using the logging operator with kubernetes...
# fluent-bit
b
Hi - Im using the logging operator with kubernetes and I'm trying to change the json schema that gets sent to the destination output. How would I do that? Example: If the default is
Copy code
{
  "namespace": "test"
}
i would want:
Copy code
{
  "some_new_field": "some_new_value",
  "spec": {
    "namespace": "test"
  }
}
p
Which logging operator and what output?
The docs cover the various outputs and filters you can use to modify data: https://docs.fluentbit.io/manual/ Typically a config map is made for the config by whichever operator you're using
Nest, lua and modify filters may be of interest
However some outputs let you directly configure their data as well so you can check the docs for them too
Essentially every record in Fluent Bit is structured data in msgpack format: You can certainly modify the contents of that record in any way you want using the filters/processors. In your case you want to
nest
the
namespace
key under a new one and then add a new key with the
modify
filter. Or you can do it all in one go with a bit of LUA which may be easier.