apiVersion: v1
kind: ConfigMap
metadata:
  name: td-agent-config
data:
  td-agent.conf: |
    <match td.*.*>
      @type tdlog
      apikey YOUR_API_KEY
      auto_create_table
      buffer_type file
      buffer_path /var/log/td-agent/buffer/td
      <secondary>
        @type file
        path /var/log/td-agent/failed_records
      </secondary>
    </match>

    <match debug.**>
      @type stdout
    </match>

    <source>
      @type forward
    </source>

    <source>
      @type http
      port 8888
    </source>

    <source>
      @type debug_agent
      bind 127.0.0.1
      port 24230
    </source>

    <source>
      type tail
      path /var/log/alternatives.log
      tag *
      format syslog
      time_format %b %d %H:%M:%S
      pos_file /tmp/fluentd--1540994275.pos
    </source>

    <source>
      type tail
      path /log/app.log
      tag *
      format /^\[(?<time>[^\]]*)\] (?<type>[^ ]*) (?<message>.*)$/
      pos_file /tmp/fluentd--1540995759.pos
    </source>

    <match log.*.*>
      @type forward
      flush_interval 5s
      log_level trace
      <server>
        name fluent-ui
        host fluent-ui-service
        port 24224
      </server>
      <secondary>
        @type file
        path /tmp/forwa1rd-failed
      </secondary>
    </match>