File Output 🔗︎

Overview 🔗︎

This plugin has been designed to output logs or metrics to File.

Configuration 🔗︎

FileOutputConfig 🔗︎

path (string, required) 🔗︎

The Path of the file. The actual path is path + time + “.log” by default.

Default: -

append (bool, optional) 🔗︎

The flushed chunk is appended to existence file or not. The default is not appended.

Default: -

add_path_suffix (*bool, optional) 🔗︎

Add path suffix(default: true)

Default: true

path_suffix (string, optional) 🔗︎

The suffix of output result.

Default: “.log”

Create symlink to temporary buffered file when buffer_type is file. This is useful for tailing file content to check logs.

Default: false

format (*Format, optional) 🔗︎

Format

Default: -

buffer (*Buffer, optional) 🔗︎

Buffer

Default: -

Example File output configurations 🔗︎

apiVersion: logging.banzaicloud.io/v1beta1
kind: Output
metadata:
 name: demo-output
spec:
 file:
   path: /tmp/logs/${tag}/%Y/%m/%d.%H.%M
   append: true
   buffer:
     timekey: 1m
     timekey_wait: 10s
     timekey_use_utc: true

Fluentd Config Result 🔗︎

 <match **>
   @type file
   @id test_file
   add_path_suffix true
   append true
   path /tmp/logs/${tag}/%Y/%m/%d.%H.%M
   <buffer tag,time>
     @type file
     path /buffers/test_file.*.buffer
     retry_forever true
     timekey 1m
     timekey_use_utc true
     timekey_wait 30s
   </buffer>
 </match>