I believe there is a bug in the Filebeat AWS ELB ingest pipeline. In Kibana Logs, they show up as:
[aws][access] 1.2.3.4 "GET HTTP/2.0" 200 152966
Clearly missing the request path. I was able to fix this with the following change:
--- a/x-pack/filebeat/module/aws/elb/ingest/pipeline.yml
+++ b/x-pack/filebeat/module/aws/elb/ingest/pipeline.yml
@@ -77,7 +77,7 @@ processors:
(?:-|%{NUMBER:aws.elb.backend.http.response.status_code:long})
%{NUMBER:http.request.body.bytes:long}
%{NUMBER:http.response.body.bytes:long}
- \"(?:-|%{WORD:http.request.method}) (?:-|%{NOTSPACE:http.request.referrer}) (?:-|HTTP/%{NOTSPACE:http.version})\"
+ \"(?:-|%{WORD:http.request.method}) (?:-|%{NOTSPACE:_tmp.url_orig}) (?:-|HTTP/%{NOTSPACE:http.version})\"
\"%{DATA:user_agent.original}\"
%{ELBSSL}
ELBTCPLOG: >-
@@ -110,6 +110,11 @@ processors:
field: event.category
value: web
+ - uri_parts:
+ if: 'ctx.http != null'
+ field: _tmp.url_orig
+ ignore_failure: true
+
- set:
if: 'ctx.http == null'
field: 'aws.elb.protocol'
And now it does appear correctly:
[aws][access] 1.2.3.4 "GET /blogs? HTTP/2.0" 200 6815
Apparently, Kibana Logs is using te generic_webserver
rules to display this record in both cases? And using uri_parts
correctly sets the url.*
fields that were expected, instead of http.request.referrer
.
I'm not sure why generic_webserver
is setup to always show a ?
even if no query string is present. I guess that's benign, but does look a little weird.