apiVersion: v1
kind: ConfigMap
metadata:
  name: logstash-config
  namespace: elk
  labels:
    app: logstash
data:
  pipeline.conf: |-
    input {
      beats {
        port => 5044
      }
    }

    filter {
      if [kubernetes][namespace] == "elk" or [kubernetes][namespace] == "kube-system" {
        drop {}
      }
    }

    output {
      #stdout { codec => rubydebug }
      elasticsearch { hosts => "elasticsearch:9200" }
    }