filebeat.inputs:
  - type: container
    paths:
      - '/var/lib/docker/containers/*/*.log'
    fields:
        cluster_id: ${OPENVIDU_PRO_CLUSTER_ID:${DOMAIN_OR_PUBLIC_IP:undefined}}
        node_id: master_${AWS_INSTANCE_ID:${OPENVIDU_PRO_CLUSTER_ID:${DOMAIN_OR_PUBLIC_IP:undefined}}}
        node_role: masternode
    fields_under_root: true

processors:
  - add_docker_metadata:
      host: "unix:///var/run/docker.sock"
  - add_host_metadata:
      netinfo.enabled: true

  - decode_json_fields:
      fields: ["message"]
      target: "json"
      overwrite_keys: true
  - drop_event:
      when.or:
        - contains:
            container.image.name: openvidu/openvidu-coturn
        - contains:
            container.image.name: docker.elastic.co/elasticsearch/elasticsearch
        - contains:
            container.image.name: docker.elastic.co/kibana/kibana
        - contains:
            container.image.name: docker.elastic.co/beats/filebeat-oss
        - contains:
            container.image.name: docker.elastic.co/beats/metricbeat-oss
        - contains:
            container.image.name: openvidu/openvidu-server-pro

output:
  elasticsearch:
    hosts: ["${OPENVIDU_PRO_ELASTICSEARCH_HOST}"]
    indices:
      - index: "filebeat-redis-%{+yyyy.MM.dd}"
        when.or:
          - contains:
              container.image.name: openvidu/openvidu-redis
      - index: "filebeat-replication-manager-%{+yyyy.MM.dd}"
        when.or:
          - contains:
              container.image.name: openvidu/replication-manager
      - index: "filebeat-openvidu-recording-%{+yyyy.MM.dd}"
        when.or:
          - contains:
              container.image.name: openvidu/openvidu-recording

logging.json: true
logging.metrics.enabled: false
setup.ilm.enabled: false
