input {
    beats {
        port => "5044"
    }
}

filter {
    grok {
      match => { "message" => "%{COMBINEDAPACHELOG}" }
    }
}

output {
    if "www" in [tags] {
    elasticsearch {
          hosts => ["10.46.67.137:9200"]
          index => "www-%{+YYYY.MM.dd}"
        }
    }
    if "ebk" in [tags] {
    elasticsearch {
          hosts => ["10.46.67.137:9200"]
          index => "ebk-%{+YYYY.MM.dd}"
        }
    }
    if "statistics" in [tags] {
    elasticsearch {
          hosts => ["10.46.67.137:9200"]
          index => "statistics-%{+YYYY.MM.dd}"
        }
    }
    if "search" in [tags] {
    elasticsearch {
          hosts => ["10.46.67.137:9200"]
          index => "search-%{+YYYY.MM.dd}"
        }
    }
    if "imotong" in [tags] {
    elasticsearch {
          hosts => ["10.46.67.137:9200"]
          index => "imotong-%{+YYYY.MM.dd}"
        }
    }
    if "publish" in [tags] {
    elasticsearch {
          hosts => ["10.46.67.137:9200"]
          index => "publish-%{+YYYY.MM.dd}"
        }
    }
}
