<filter kubernetes.**>
  @type kubernetes_metadata
  kubernetes_url "#{ENV['K8S_HOST_URL']}"
  cache_size "#{ENV['K8S_METADATA_CACHE_SIZE'] || '1000'}"
  watch "#{ENV['K8S_METADATA_WATCH'] || 'false'}"
  use_journal "#{ENV['USE_JOURNAL'] || 'nil'}"
  ssl_partial_chain "#{ENV['SSL_PARTIAL_CHAIN'] || 'true'}"
</filter>

<filter kubernetes.journal.**>
  @type parse_json_field
  merge_json_log "#{ENV['MERGE_JSON_LOG'] || 'false'}"
  preserve_json_log "#{ENV['PRESERVE_JSON_LOG'] || 'true'}"
  json_fields "#{ENV['JSON_FIELDS'] || 'MESSAGE,log'}"
</filter>

<filter kubernetes.var.log.containers.**>
  @type parse_json_field
  merge_json_log "#{ENV['MERGE_JSON_LOG'] || 'false'}"
  preserve_json_log "#{ENV['PRESERVE_JSON_LOG'] || 'true'}"
  json_fields "#{ENV['JSON_FIELDS'] || 'log,MESSAGE'}"
</filter>

<filter kubernetes.var.log.containers.eventrouter-** kubernetes.var.log.containers.cluster-logging-eventrouter-**>
  @type parse_json_field
  merge_json_log true
  preserve_json_log true
  json_fields "#{ENV['JSON_FIELDS'] || 'log,MESSAGE'}"
</filter>
