Logstash ersetzen @timestamp syslog Datum

Ich bin ein wenig verwirrt. Ich bin versucht zu ziehen aus der syslog date (backfilling the logstash) und ersetzen Sie die @timestamp mit ihm. Ich habe versucht, fast alles.

Dies ist mein filter

filter {
   if [type] == "syslog" {
   grok {
     match => {
"message" => ["%{SYSLOGTIMESTAMP:DATETIME} %{WORD:SERVER} (?<BINARY>(.*?)(php\-cgi|php))\: %{DATA:PHP_ERROR_TYPE}\:\s\s(?<PHP_ERROR_DESC>(.*?)(e\s\d))""]
  }
}

date {
  match => { "DATETIME" => [ "MMM  d HH:mm:ss", "MMM dd HH:mm:ss", "ISO8601" ] }
  target => "@timestamp"
  add_tag => [ "tmatch" ]
}

if !("_grokparsefailure" in [tags]) {
  mutate {
    replace => [ "@source_host", "%{SERVER}" ]
  }
}
mutate {
  remove_field => [ "SERVER" ]
}
}
}

Beispiel-Ausgabe:

{
    "message" => "Sep 10 00:00:00 xxxxxxx",
    "@timestamp" => "2013-12-05T13:29:35.169Z",
      "@version" => "1",
          "type" => "xxxx",
          "host" => "127.0.0.1:xxx",
      "DATETIME" => "Sep 10 00:00:00",
        "BINARY" => "xxxx",
"PHP_ERROR_TYPE" => "xxxx",
"PHP_ERROR_DESC" => "xxxxx",
          "tags" => [
    [0] "tmatch"
],
  "@source_host" => "xxx"
}

tmatch ist in die tags, also gehe ich davon aus, dass die Datum-filter funktioniert, aber warum ich immer noch:

@timestamp => "2013-12-05T13:29:35.169Z"

?

Danke für die Hilfe (meine logstash ist logstash-1.2.2-flatjar.jar)

InformationsquelleAutor user3070418 | 2013-12-05
Schreibe einen Kommentar