Skip to content

Commit

Permalink
[Filebeat] Preserve case of http.request.method (elastic#18359)
Browse files Browse the repository at this point in the history
* Preserve case of http.request.method

ECS previously specified normalizing http.request.method to lowercase.
This resulted in the loss of information. Affects filesets from the
following versions:

- apache/access (7.7 - 7.8)
- elasticsearch/audit (7.7 - 7.8)
- iis/access (7.7 - 7.8)
- iis/error (7.7 - 7.8)
- nginx/access (7.8)
- nginx/ingress_controller (7.8)
- aws/elb (7.7 - 7.8)
- suricata/eve (7.4 - 7.8)
- zeek/http (7.8)

Closes elastic#18154

(cherry picked from commit 87c3ad3)
  • Loading branch information
leehinman committed May 27, 2020
1 parent 5952dc2 commit 8f906ad
Show file tree
Hide file tree
Showing 31 changed files with 106 additions and 121 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
*Filebeat*

- Fix parsing of Elasticsearch node name by `elasticsearch/slowlog` fileset. {pull}14547[14547]
- Preserve case of http.request.method. ECS prior to 1.6 specified normalizing to lowercase, which lost information. Affects filesets: apache/access, elasticsearch/audit, iis/access, iis/error, aws/elb, suricata/eve. {issue}18154[18154] {pull}18359[18359]

*Heartbeat*

Expand Down
3 changes: 0 additions & 3 deletions filebeat/module/apache/access/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ processors:
field: event.outcome
value: failure
if: "ctx?.http?.response?.status_code != null && ctx.http.response.status_code > 399"
- lowercase:
field: http.request.method
ignore_missing: true
- grok:
field: source.address
ignore_missing: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"event.module": "apache",
"event.outcome": "success",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.response.body.bytes": 45,
"http.response.status_code": 200,
"http.version": "1.1",
Expand All @@ -27,7 +27,7 @@
"event.module": "apache",
"event.outcome": "failure",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.response.body.bytes": 209,
"http.response.status_code": 404,
"http.version": "1.1",
Expand Down Expand Up @@ -63,7 +63,7 @@
"event.module": "apache",
"event.outcome": "success",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.response.body.bytes": 45,
"http.response.status_code": 200,
"http.version": "1.1",
Expand Down Expand Up @@ -92,7 +92,7 @@
"event.module": "apache",
"event.outcome": "failure",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.response.body.bytes": 206,
"http.response.status_code": 404,
"http.version": "1.1",
Expand Down Expand Up @@ -121,7 +121,7 @@
"event.module": "apache",
"event.outcome": "failure",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.response.body.bytes": 201,
"http.response.status_code": 404,
"http.version": "1.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"event.kind": "event",
"event.module": "apache",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.response.body.bytes": 1375,
"http.version": "1.1",
"input.type": "log",
Expand All @@ -30,7 +30,7 @@
"event.kind": "event",
"event.module": "apache",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.version": "1.1",
"input.type": "log",
"log.offset": 276,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"event.module": "apache",
"event.outcome": "failure",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.request.referrer": "-",
"http.response.body.bytes": 499,
"http.response.status_code": 404,
Expand Down
8 changes: 4 additions & 4 deletions filebeat/module/apache/access/test/test.log-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"event.module": "apache",
"event.outcome": "failure",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.response.body.bytes": 209,
"http.response.status_code": 404,
"http.version": "1.1",
Expand All @@ -27,7 +27,7 @@
"event.module": "apache",
"event.outcome": "failure",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.request.referrer": "-",
"http.response.body.bytes": 499,
"http.response.status_code": 404,
Expand Down Expand Up @@ -71,7 +71,7 @@
"event.module": "apache",
"event.outcome": "failure",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.request.referrer": "-",
"http.response.body.bytes": 612,
"http.response.status_code": 404,
Expand Down Expand Up @@ -99,7 +99,7 @@
"event.module": "apache",
"event.outcome": "success",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.request.referrer": "-",
"http.response.body.bytes": 612,
"http.response.status_code": 200,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"event.module": "apache",
"event.outcome": "success",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.request.referrer": "-",
"http.response.body.bytes": 491,
"http.response.status_code": 200,
Expand All @@ -33,7 +33,7 @@
"event.module": "apache",
"event.outcome": "success",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.request.referrer": "-",
"http.response.body.bytes": 484,
"http.response.status_code": 200,
Expand Down Expand Up @@ -61,7 +61,7 @@
"event.module": "apache",
"event.outcome": "failure",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.request.referrer": "http://192.168.33.72/",
"http.response.body.bytes": 504,
"http.response.status_code": 404,
Expand Down Expand Up @@ -89,7 +89,7 @@
"event.module": "apache",
"event.outcome": "success",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.request.referrer": "-",
"http.response.body.bytes": 484,
"http.response.status_code": 200,
Expand Down Expand Up @@ -117,7 +117,7 @@
"event.module": "apache",
"event.outcome": "failure",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.request.referrer": "-",
"http.response.body.bytes": 504,
"http.response.status_code": 404,
Expand Down Expand Up @@ -145,7 +145,7 @@
"event.module": "apache",
"event.outcome": "failure",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.request.referrer": "-",
"http.response.body.bytes": 504,
"http.response.status_code": 404,
Expand Down Expand Up @@ -173,7 +173,7 @@
"event.module": "apache",
"event.outcome": "failure",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.request.referrer": "-",
"http.response.body.bytes": 498,
"http.response.status_code": 404,
Expand Down Expand Up @@ -201,7 +201,7 @@
"event.module": "apache",
"event.outcome": "failure",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.request.referrer": "-",
"http.response.body.bytes": 499,
"http.response.status_code": 404,
Expand Down Expand Up @@ -229,7 +229,7 @@
"event.module": "apache",
"event.outcome": "failure",
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.request.referrer": "-",
"http.response.body.bytes": 499,
"http.response.status_code": 404,
Expand Down
3 changes: 0 additions & 3 deletions filebeat/module/elasticsearch/audit/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ processors:
ctx.event.outcome = 'failure';
}
- lowercase:
field: http.request.method
ignore_missing: true
- set:
field: host.id
value: "{{elasticsearch.node.id}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"event.outcome": "failure",
"fileset.name": "audit",
"host.id": "Xaq2BFVcQ1OhyMrjL8gNOg",
"http.request.method": "get",
"http.request.method": "GET",
"input.type": "log",
"log.offset": 0,
"message": "{\"type\": \"audit\", \"timestamp\":\"2019-06-11T15:03:32,102+0000\", \"node.id\":\"Xaq2BFVcQ1OhyMrjL8gNOg\", \"event.type\":\"rest\", \"event.action\":\"anonymous_access_denied\", \"origin.type\":\"rest\", \"origin.address\":\"172.17.0.1:40380\", \"url.path\":\"/\", \"request.method\":\"GET\", \"request.id\":\"pkduyMB5Tly6xgmkYbZi-A\"}",
Expand All @@ -37,7 +37,7 @@
"event.outcome": "failure",
"fileset.name": "audit",
"host.id": "Xaq2BFVcQ1OhyMrjL8gNOg",
"http.request.method": "get",
"http.request.method": "GET",
"input.type": "log",
"log.offset": 690,
"message": "{\"type\": \"audit\", \"timestamp\":\"2019-06-11T15:03:32,778+0000\", \"node.id\":\"Xaq2BFVcQ1OhyMrjL8gNOg\", \"event.type\":\"rest\", \"event.action\":\"authentication_failed\", \"user.name\":\"elastic\", \"origin.type\":\"rest\", \"origin.address\":\"172.17.0.1:40380\", \"url.path\":\"/\", \"request.method\":\"GET\", \"request.id\":\"KPgEINaXSbGNaIobp8OcMw\"}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
"fileset.name": "audit",
"host.id": "y8fa3M5zSSGo1M_KJRMUXw",
"http.request.body.content": "\n{\n \"query\" : {\n \"term\" : { \"user\" : \"kimchy\" }\n }\n}\n",
"http.request.method": "get",
"http.request.method": "GET",
"input.type": "log",
"log.offset": 2056,
"message": "{\"@timestamp\":\"2019-01-27T20:15:10,380\", \"node.name\":\"node-0\", \"node.id\":\"y8fa3M5zSSGo1M_KJRMUXw\", \"event.type\":\"rest\", \"event.action\":\"authentication_success\", \"user.name\":\"elastic-admin\", \"origin.type\":\"rest\", \"origin.address\":\"[::1]:58955\", \"realm\":\"default_file\", \"url.path\":\"/_search\", \"request.method\":\"GET\", \"request.body\":\"\\n{\\n \\\"query\\\" : {\\n \\\"term\\\" : { \\\"user\\\" : \\\"kimchy\\\" }\\n }\\n}\\n\", \"request.id\":\"WzL_kb6VSvOhAq0twPvHOQ\"}",
Expand Down
3 changes: 0 additions & 3 deletions filebeat/module/iis/access/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ processors:
field: event.type
value: connection
if: "ctx?.source?.ip != null && ctx?.destination?.ip != null"
- lowercase:
field: http.request.method
ignore_missing: true
- append:
field: related.ip
value: "{{source.ip}}"
Expand Down
10 changes: 5 additions & 5 deletions filebeat/module/iis/access/test/test-iis-7.2.log-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"connection"
],
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.response.status_code": 404,
"iis.access.sub_status": 0,
"iis.access.win32_status": 64,
Expand Down Expand Up @@ -58,7 +58,7 @@
"connection"
],
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.response.status_code": 404,
"iis.access.sub_status": 0,
"iis.access.win32_status": 2,
Expand Down Expand Up @@ -99,7 +99,7 @@
"connection"
],
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.response.status_code": 401,
"iis.access.sub_status": 0,
"iis.access.win32_status": 0,
Expand Down Expand Up @@ -139,7 +139,7 @@
"connection"
],
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.response.status_code": 401,
"iis.access.sub_status": 0,
"iis.access.win32_status": 0,
Expand Down Expand Up @@ -179,7 +179,7 @@
"connection"
],
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.response.status_code": 404,
"iis.access.sub_status": 0,
"iis.access.win32_status": 64,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"connection"
],
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.response.status_code": 404,
"iis.access.sub_status": 4,
"iis.access.win32_status": 2,
Expand Down Expand Up @@ -57,7 +57,7 @@
"connection"
],
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.response.status_code": 200,
"iis.access.sub_status": 0,
"iis.access.win32_status": 0,
Expand Down Expand Up @@ -90,7 +90,7 @@
"connection"
],
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.response.status_code": 200,
"iis.access.sub_status": 0,
"iis.access.win32_status": 0,
Expand Down Expand Up @@ -123,7 +123,7 @@
"connection"
],
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.response.status_code": 200,
"iis.access.sub_status": 0,
"iis.access.win32_status": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"fileset.name": "access",
"http.request.body.bytes": 456,
"http.request.method": "get",
"http.request.method": "GET",
"http.response.body.bytes": 123,
"http.response.status_code": 200,
"http.version": "1.1",
Expand Down
10 changes: 5 additions & 5 deletions filebeat/module/iis/access/test/test.log-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"connection"
],
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.response.status_code": 200,
"iis.access.sub_status": 0,
"iis.access.win32_status": 0,
Expand Down Expand Up @@ -63,7 +63,7 @@
"event.outcome": "success",
"fileset.name": "access",
"http.request.body.bytes": 456,
"http.request.method": "get",
"http.request.method": "GET",
"http.response.body.bytes": 123,
"http.response.status_code": 200,
"iis.access.site_name": "W3SVC1",
Expand Down Expand Up @@ -106,7 +106,7 @@
],
"fileset.name": "access",
"http.request.body.bytes": 456,
"http.request.method": "get",
"http.request.method": "GET",
"http.response.body.bytes": 123,
"http.response.status_code": 200,
"http.version": "1.1",
Expand Down Expand Up @@ -159,7 +159,7 @@
"connection"
],
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.response.status_code": 401,
"iis.access.sub_status": 0,
"iis.access.win32_status": 0,
Expand Down Expand Up @@ -200,7 +200,7 @@
"connection"
],
"fileset.name": "access",
"http.request.method": "get",
"http.request.method": "GET",
"http.response.status_code": 404,
"iis.access.sub_status": 0,
"iis.access.win32_status": 2,
Expand Down
3 changes: 0 additions & 3 deletions filebeat/module/iis/error/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ processors:
field: event.type
value: connection
if: "ctx?.source?.ip != null && ctx?.destination?.ip != null"
- lowercase:
field: http.request.method
ignore_missing: true
- append:
field: related.ip
value: "{{source.ip}}"
Expand Down
Loading

0 comments on commit 8f906ad

Please sign in to comment.