# This file is managed by Chef

filter {
  if [type] == "mesos_slave" or [type] == "mesos_master" {
    grok {
      match => ["message", "%{ET_MESOS}"]
    }

    date {
      match => ["timestamp", "MMdd HH:mm:ss.S", "MMdd HH:mm:ss.SS", "MMdd HH:mm:ss.SSS", "MMdd HH:mm:ss"]
      remove_field => [ "timestamp" ]
    }

    alter {
      condrewrite => [
        "level_short", "I", "INFO",
        "level_short", "W", "WARN",
        "level_short", "E", "ERROR",
        "level_short", "F", "FATAL"
      ]
      remove_field => [ "level_short" ]
    }
  }

  if [type] == "singularity" {
    multiline {
      pattern => "^! "
      what => "previous"
    }

    grok {
      match => ["message", "%{ET_SINGULARITY}"]
    }

    date {
      match => ["timestamp", "YYYY-MM-dd HH:mm:ss,SSS", "YYYY-MM-dd HH:mm:ss,S", "ISO8601"]
      remove_field => [ "timestamp" ]
    }


  }
}
