Ok so I got something working.
First I have to create a record in the Flow.
spec:
filters:
- record_transformer:
enable_ruby: true
records:
- namespace_name: ${record['kubernetes']['namespace_name']}
Then I have to add it to a buffer in the Output(no idea what this actually does):
spec:
s3:
buffer:
tags: namespace_name, tag, time
Then I can use it in the path:
path: /logs/${namespace_name}/