Input example line in log:
2021-12-23T00:02:54.126Z 10.173.7.76 - - [23/Dec/2021:00:02:53 +0000] "POST /uri1/uri2?queryp=00-0A-12-34-56-78 HTTP/1.1" 403 2001 "-" "useragent" 0 [500456]
Grok filter expression:
filter {
grok {
match => [ "message", "%{TIMESTAMP_ISO8601:log_timestamp} %{IP:alb_name} %{USER:client_id} %{USER:user_id} \[%{HTTPDATE:request_timestamp}\] \"(?:%{WORD:http_method} %{DATA:request_uri}(?: HTTP/%{NUMBER:http_version:float})?|%{DATA:rawrequest})\" %{NUMBER:target_status_code:int} (?:%{NUMBER:response_bytes:int}|-) %{QS:referrer} %{QS:user_agent} %{NUMBER:target_processing_time_s:int} \[%{NUMBER:target_processing_time_us:int}\]" ]
}
date {
match => [ "request_timestamp", "dd/MMM/yyyy:HH:mm:ss ZZZZ" ]
target => "@timestamp"
add_field => { "debug" => "timestampMatched"}
}
}
Actual output:
@timestamp 2021-12-23T00:02:54.126Z
request_timestamp 23/Dec/2021:00:02:53 +0000
Expected output:
@timestamp 23/Dec/2021-12-23T:00:02:53 +0000
request_timestamp 23/Dec/2021:00:02:53 +0000
What should be done in the grok filter expression to get the expected output?
Where do i find "timestampMatched" getting printed: /var/log/logstash/logstash-plain.log? stdout? Kibana as a field in index with key-value "debug": "timestampMatched"?
Note:
There are quite a few similar queries in this forum and other forums. The answers do Not work for everyone. ELK being something that heavily leverages "time series", please provide a proper answer that is tested and verified to be working for all popular formats with ELK. If you wish to Not be answering another 100 such similar queries in the coming years, please provide a list of filter codeblocks that match each of the popular time format and make it appear as @timestamp in Kibana (be sure to test it). Because, whatever documentation you provide is Not helping, as far as I can see from the different forums.