Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <source>
- @type tail
- # audit log path of kube-apiserver
- path /tmp/kube-apiserver-audit.log
- pos_file /tmp/audit.pos
- format json
- time_key time
- time_format %Y-%m-%dT%H:%M:%S.%N%z
- tag audit
- </source>
- <filter audit>
- #https://github.com/fluent/fluent-plugin-rewrite-tag-filter/issues/13
- type record_transformer
- enable_ruby
- <record>
- namespace ${record["objectRef"].nil?"none":(record["objectRef"]["namespace"].nil? "none":record["objectRef"]["namespace"])}
- </record>
- </filter>
- <match audit>
- # route audit according to namespace element in context
- @type rewrite_tag_filter
- rewriterule1 namespace ^(.+) ${tag}.$1
- </match>
- <filter audit.**>
- @type record_transformer
- remove_keys namespace
- </filter>
- <match audit.**>
- @type forest
- subtype file
- remove_prefix audit
- <template>
- time_slice_format %Y%m%d%H
- compress gz
- path /tmp/audit-${tag}.*.log
- format json
- include_time_key true
- </template>
- </match>
Add Comment
Please, Sign In to add comment