<source>
@type tail
path /var/log/test/access.log
pos_file /var/log/test/access.log.pos
tag kubernetes.var.log.containers.**
format none
</source>
<match kubernetes.var.log.containers.**>
@type rewrite_tag_filter
<rule>
key kubernetes.labels.javaBoot
pattern .+
tag java.${tag}
</rule>
</match>
<filter java.**>
@type parser
format /^(?<time>\d{4}-\d{1,2}-\d{1,2} \d{2}:\d{2}:\d{2}\.\d{3})\s+(?<level>[^\s]*)\s+\[(?<service>[^,]*),(?<trace>[^,]*),(?<span>[^,]*),(?<exportable>[^\]]*)\]\s+(?<pid>[^\s]*)\s+---\s+\[(?<thread>[^\]]*)\]\s+(?<class>[^\s]*)\s+:\s+(?<message>.*)/
time_format "%Y-%m-%d %H:%M:%S\.%L"
keep_time_key true
key_name log
emit_invalid_record_to_error true
</filter>
<match java.**>
@type stdout
</match>
<match **>
@type elasticsearch
</match>
<label @ERROR>
<match **>
@type stdout
</match>
</label>