Hello
I hava a problem about date filter.
My conf is below.
input {
file { path => "/var/log/secure" }
}
filter {
dissect { mapping => { "message" => "%{timestamp->} %{+timestamp} %{+timestamp} %{hostname} %{another}" } }
date { match => [ "timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ] }
}
output {
elasticsearch { hosts => "localhost:9200" }
}
This is a result of my conf. The november log was recorded in 2019. But The december log was recorded in 2018. Am i wrong?
{
"hostname" => "MHKG",
"host" => "MHKG",
"another" => "sshd[13361]: Received disconnect from ::ffff:192.168.244.18: 11: Disconnect requested by Windows SSH Client.\r",
"message" => "Nov 30 23:44:36 Sensor sshd[13361]: Received disconnect from ::ffff:192.168.244.18: 11: Disconnect requested by Windows SSH Client.\r",
"path" => "/var/log/secure",
"@timestamp" => 2019-11-30T23:44:36.000Z,
"timestamp" => "Nov 30 23:44:36",
"@version" => "1"
}
{
"hostname" => "MHKG",
"host" => "MHKG",
"another" => "sshd[2264]: Accepted password for root from 192.168.56.1 port 8246 ssh2\r",
"message" => "Dec 1 02:38:21 Sensor sshd[2264]: Accepted password for root from 192.168.56.1 port 8246 ssh2\r",
"path" => "/var/log/secure",
"@timestamp" => 2018-12-01T02:38:21.000Z,
"timestamp" => "Dec 1 02:38:21",
"@version" => "1"
}