echo "Nov 25 11:12:15 test message goes here" | /usr/share/logstash/bin/logstash -e 'input { stdin {} }
filter {
grok {
keep_empty_captures => true
match => { "message" =>
"^(?<logTime>%{SYSLOGTIMESTAMP:ts}) .*$" }
add_tag => ["parsed_msg"]
remove_tag => ["_grokparsefailure"]
}
date {
match => [ "ts", "MMM d hh:mm:ss", "MMM dd hh:mm:ss", "ISO8601" ]
target => "@timestamp"
remove_field => ["ts"]
}
}' --path.data /tmp/test
---output -----
{
"logTime" => "Nov 25 11:12:15",
"@version" => "1",
"message" => "Nov 25 11:12:15 test message goes here",
"@timestamp" => 2021-11-25T16:12:15.000Z,
"host" => "myhost",
"tags" => [
[0] "parsed_msg"
]
}
------ problem/Expectation ------
Actual hour stamp is 11 hour, the @timestamp shows 16 hour; why?
How can we make @timestamp show hour as 11?