Skip to content

Commit

Permalink
Add http.request.mehod to Kibana log filset (#7607)
Browse files Browse the repository at this point in the history
Take `http.request.method` from ECS and apply it to the Kibana fileset.

Additional logs are added to the example log files.
  • Loading branch information
ruflin authored and jsoriano committed Jul 18, 2018
1 parent c0a8e17 commit 5eaf0b6
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 2 deletions.
4 changes: 4 additions & 0 deletions filebeat/_meta/fields.common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,7 @@
description: >
Content length of the HTTP response body.
- name: http.request.method
type: keyword
description: >
Request method.
10 changes: 10 additions & 0 deletions filebeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2651,6 +2651,16 @@ type: long
Content length of the HTTP response body.
--
*`http.request.method`*::
+
--
type: keyword
Request method.
--
[[exported-fields-logstash]]
Expand Down
2 changes: 1 addition & 1 deletion filebeat/include/fields.go

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions filebeat/module/kibana/log/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@
"ignore_missing": true
}
},
{
"rename": {
"field": "kibana.log.meta.req.method",
"target_field": "http.request.method",
"ignore_missing": true
}
},
{
"date": {
"field": "read_timestamp",
Expand Down
2 changes: 2 additions & 0 deletions filebeat/module/kibana/log/test/test.log
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{"type":"response","@timestamp":"2018-05-09T10:57:55Z","tags":[],"pid":69410,"method":"get","statusCode":304,"req":{"url":"/ui/fonts/open_sans/open_sans_v15_latin_600.woff2","method":"get","headers":{"host":"localhost:5601","connection":"keep-alive","origin":"http://localhost:5601","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36","accept":"*/*","referer":"http://localhost:5601/app/kibana","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9,de;q=0.8","if-none-match":"\"24234c1c81b3948758c1a0be8e5a65386ca94c52\"","if-modified-since":"Thu, 03 May 2018 09:45:28 GMT"},"remoteAddress":"127.0.0.1","userAgent":"127.0.0.1","referer":"http://localhost:5601/app/kibana"},"res":{"statusCode":304,"responseTime":26,"contentLength":9},"message":"GET /ui/fonts/open_sans/open_sans_v15_latin_600.woff2 304 26ms - 9.0B"}
{"type":"log","@timestamp":"2018-05-09T10:59:12Z","tags":["debug","monitoring-ui","kibana-monitoring"],"pid":69776,"message":"Fetching data from kibana_stats collector"}
{"type":"log","@timestamp":"2018-05-09T10:59:12Z","tags":["reporting","debug","exportTypes"],"pid":69776,"message":"Found exportType at /Users/ruflin/Downloads/6.3/kibana-6.3.0-darwin-x86_64/node_modules/x-pack/plugins/reporting/export_types/csv/server/index.js"}
40 changes: 39 additions & 1 deletion filebeat/module/kibana/log/test/test.log-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"@timestamp": "2018-05-09T10:57:55.000Z",
"fileset.module": "kibana",
"fileset.name": "log",
"http.request.method": "get",
"http.response.content_length": 9,
"http.response.elapsed_time": 26,
"http.response.status_code": 304,
Expand All @@ -18,7 +19,6 @@
"kibana.log.meta.req.headers.origin": "http://localhost:5601",
"kibana.log.meta.req.headers.referer": "http://localhost:5601/app/kibana",
"kibana.log.meta.req.headers.user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36",
"kibana.log.meta.req.method": "get",
"kibana.log.meta.req.referer": "http://localhost:5601/app/kibana",
"kibana.log.meta.req.remoteAddress": "127.0.0.1",
"kibana.log.meta.req.url": "/ui/fonts/open_sans/open_sans_v15_latin_600.woff2",
Expand All @@ -33,5 +33,43 @@
"service.name": [
"kibana"
]
},
{
"@timestamp": "2018-05-09T10:59:12.000Z",
"fileset.module": "kibana",
"fileset.name": "log",
"input.type": "log",
"kibana.log.meta.type": "log",
"kibana.log.tags": [
"debug",
"monitoring-ui",
"kibana-monitoring"
],
"message": "Fetching data from kibana_stats collector",
"offset": 920,
"process.pid": 69776,
"prospector.type": "log",
"service.name": [
"kibana"
]
},
{
"@timestamp": "2018-05-09T10:59:12.000Z",
"fileset.module": "kibana",
"fileset.name": "log",
"input.type": "log",
"kibana.log.meta.type": "log",
"kibana.log.tags": [
"reporting",
"debug",
"exportTypes"
],
"message": "Found exportType at /Users/ruflin/Downloads/6.3/kibana-6.3.0-darwin-x86_64/node_modules/x-pack/plugins/reporting/export_types/csv/server/index.js",
"offset": 1090,
"process.pid": 69776,
"prospector.type": "log",
"service.name": [
"kibana"
]
}
]

0 comments on commit 5eaf0b6

Please sign in to comment.