mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
Use date filter to set the timestamp from the haproxy accept_date
This commit is contained in:
parent
19ef89428e
commit
e7f5d3af85
1 changed files with 3 additions and 3 deletions
|
@ -10,8 +10,8 @@ describe "haproxy httplog format" do
|
|||
grok {
|
||||
pattern => "%{HAPROXYHTTP}"
|
||||
}
|
||||
mutate {
|
||||
replace => ['@timestamp', '%{accept_date}']
|
||||
date {
|
||||
match => ["accept_date", "dd/MMM/yyyy:HH:mm:ss.SSS"]
|
||||
}
|
||||
}
|
||||
CONFIG
|
||||
|
@ -114,7 +114,7 @@ describe "haproxy httplog format" do
|
|||
insist{ subject["http_request"] } == ["/index.html"]
|
||||
insist{ subject["http_version"] } == ["1.1"]
|
||||
# Verify date parsing
|
||||
insist { subject.timestamp } == "06/Feb/2009:12:14:14.655"
|
||||
insist { subject.timestamp } == "2009-02-06T20:14:14.655Z"
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue