Skip to content

Commit

Permalink
Remove trailing whitespace from golden files (#9827)
Browse files Browse the repository at this point in the history
When system tests are run with the `GENERATE` environment variable set, we regenerate golden files used by these tests. To do this we use the Python `json.dump` function, which adds trailing whitespaces when it is called with the `indent` argument (which we do). From the Python docs at https://docs.python.org/2/library/json.html:

> Note Since the default item separator is ', ', the output might include trailing whitespace when indent is specified. You can use separators=(',', ': ') to avoid this.

Per the suggestion in the docs, this change adds the `separators` argument as well, to avoid generating trailing whitespace.

This PR also regenerates all golden files with the new regeneration code.
  • Loading branch information
ycombinator authored Dec 28, 2018
1 parent 2c6030d commit bb92226
Show file tree
Hide file tree
Showing 38 changed files with 3,453 additions and 3,453 deletions.
186 changes: 93 additions & 93 deletions filebeat/module/apache2/access/test/test.log-expected.json
Original file line number Diff line number Diff line change
@@ -1,106 +1,106 @@
[
{
"@timestamp": "2016-12-26T14:16:29.000Z",
"apache2.access.body_sent.bytes": 209,
"apache2.access.remote_ip": "::1",
"ecs.version": "1.0.0-beta2",
"event.dataset": "access",
"event.module": "apache2",
"http.request.method": "GET",
"http.response.status_code": 404,
"http.version": "1.1",
"input.type": "log",
"log.offset": 0,
"source.ip": "::1",
"url.original": "/favicon.ico",
"@timestamp": "2016-12-26T14:16:29.000Z",
"apache2.access.body_sent.bytes": 209,
"apache2.access.remote_ip": "::1",
"ecs.version": "1.0.0-beta2",
"event.dataset": "access",
"event.module": "apache2",
"http.request.method": "GET",
"http.response.status_code": 404,
"http.version": "1.1",
"input.type": "log",
"log.offset": 0,
"source.ip": "::1",
"url.original": "/favicon.ico",
"user.name": "-"
},
},
{
"@timestamp": "2016-12-26T16:22:13.000Z",
"apache2.access.body_sent.bytes": 499,
"apache2.access.remote_ip": "192.168.33.1",
"ecs.version": "1.0.0-beta2",
"event.dataset": "access",
"event.module": "apache2",
"http.request.method": "GET",
"http.request.referrer": "-",
"http.response.status_code": 404,
"http.version": "1.1",
"input.type": "log",
"log.offset": 73,
"source.ip": "192.168.33.1",
"url.original": "/hello",
"user.name": "-",
"user_agent.device": "Other",
"user_agent.major": "50",
"user_agent.minor": "0",
"user_agent.name": "Firefox",
"user_agent.original": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:50.0) Gecko/20100101 Firefox/50.0",
"user_agent.os.full_name": "Mac OS X 10.12",
"user_agent.os.major": "10",
"user_agent.os.minor": "12",
"@timestamp": "2016-12-26T16:22:13.000Z",
"apache2.access.body_sent.bytes": 499,
"apache2.access.remote_ip": "192.168.33.1",
"ecs.version": "1.0.0-beta2",
"event.dataset": "access",
"event.module": "apache2",
"http.request.method": "GET",
"http.request.referrer": "-",
"http.response.status_code": 404,
"http.version": "1.1",
"input.type": "log",
"log.offset": 73,
"source.ip": "192.168.33.1",
"url.original": "/hello",
"user.name": "-",
"user_agent.device": "Other",
"user_agent.major": "50",
"user_agent.minor": "0",
"user_agent.name": "Firefox",
"user_agent.original": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:50.0) Gecko/20100101 Firefox/50.0",
"user_agent.os.full_name": "Mac OS X 10.12",
"user_agent.os.major": "10",
"user_agent.os.minor": "12",
"user_agent.os.name": "Mac OS X"
},
},
{
"@timestamp": "2016-12-26T14:16:48.000Z",
"apache2.access.remote_ip": "::1",
"ecs.version": "1.0.0-beta2",
"event.dataset": "access",
"event.module": "apache2",
"http.response.status_code": 408,
"input.type": "log",
"log.offset": 238,
"source.ip": "::1",
"@timestamp": "2016-12-26T14:16:48.000Z",
"apache2.access.remote_ip": "::1",
"ecs.version": "1.0.0-beta2",
"event.dataset": "access",
"event.module": "apache2",
"http.response.status_code": 408,
"input.type": "log",
"log.offset": 238,
"source.ip": "::1",
"user.name": "-"
},
},
{
"@timestamp": "2017-05-29T19:02:48.000Z",
"apache2.access.body_sent.bytes": 612,
"apache2.access.remote_ip": "172.17.0.1",
"ecs.version": "1.0.0-beta2",
"event.dataset": "access",
"event.module": "apache2",
"http.request.method": "GET",
"http.request.referrer": "-",
"http.response.status_code": 404,
"http.version": "1.1",
"input.type": "log",
"log.offset": 285,
"source.ip": "172.17.0.1",
"url.original": "/stringpatch",
"user.name": "-",
"user_agent.device": "Other",
"user_agent.major": "15",
"user_agent.minor": "0",
"user_agent.name": "Firefox Alpha",
"user_agent.original": "Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20120716 Firefox/15.0a2",
"user_agent.os.full_name": "Windows 7",
"user_agent.os.name": "Windows 7",
"@timestamp": "2017-05-29T19:02:48.000Z",
"apache2.access.body_sent.bytes": 612,
"apache2.access.remote_ip": "172.17.0.1",
"ecs.version": "1.0.0-beta2",
"event.dataset": "access",
"event.module": "apache2",
"http.request.method": "GET",
"http.request.referrer": "-",
"http.response.status_code": 404,
"http.version": "1.1",
"input.type": "log",
"log.offset": 285,
"source.ip": "172.17.0.1",
"url.original": "/stringpatch",
"user.name": "-",
"user_agent.device": "Other",
"user_agent.major": "15",
"user_agent.minor": "0",
"user_agent.name": "Firefox Alpha",
"user_agent.original": "Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20120716 Firefox/15.0a2",
"user_agent.os.full_name": "Windows 7",
"user_agent.os.name": "Windows 7",
"user_agent.patch": "a2"
},
},
{
"@timestamp": "2017-05-29T19:02:48.000Z",
"apache2.access.body_sent.bytes": 612,
"apache2.access.remote_ip": "monitoring-server",
"ecs.version": "1.0.0-beta2",
"event.dataset": "access",
"event.module": "apache2",
"http.request.method": "GET",
"http.request.referrer": "-",
"http.response.status_code": 200,
"http.version": "1.1",
"input.type": "log",
"log.offset": 443,
"source.domain": "monitoring-server",
"url.original": "/status",
"user.name": "-",
"user_agent.device": "Other",
"user_agent.major": "15",
"user_agent.minor": "0",
"user_agent.name": "Firefox Alpha",
"user_agent.original": "Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20120716 Firefox/15.0a2",
"user_agent.os.full_name": "Windows 7",
"user_agent.os.name": "Windows 7",
"@timestamp": "2017-05-29T19:02:48.000Z",
"apache2.access.body_sent.bytes": 612,
"apache2.access.remote_ip": "monitoring-server",
"ecs.version": "1.0.0-beta2",
"event.dataset": "access",
"event.module": "apache2",
"http.request.method": "GET",
"http.request.referrer": "-",
"http.response.status_code": 200,
"http.version": "1.1",
"input.type": "log",
"log.offset": 443,
"source.domain": "monitoring-server",
"url.original": "/status",
"user.name": "-",
"user_agent.device": "Other",
"user_agent.major": "15",
"user_agent.minor": "0",
"user_agent.name": "Firefox Alpha",
"user_agent.original": "Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20120716 Firefox/15.0a2",
"user_agent.os.full_name": "Windows 7",
"user_agent.os.name": "Windows 7",
"user_agent.patch": "a2"
}
]
60 changes: 30 additions & 30 deletions filebeat/module/apache2/error/test/test.log-expected.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
[
{
"@timestamp": "2016-12-26T16:22:08.000Z",
"ecs.version": "1.0.0-beta2",
"event.dataset": "error",
"event.module": "apache2",
"input.type": "log",
"log.level": "error",
"log.offset": 0,
"message": "File does not exist: /var/www/favicon.ico",
"@timestamp": "2016-12-26T16:22:08.000Z",
"ecs.version": "1.0.0-beta2",
"event.dataset": "error",
"event.module": "apache2",
"input.type": "log",
"log.level": "error",
"log.offset": 0,
"message": "File does not exist: /var/www/favicon.ico",
"source.address": "192.168.33.1"
},
},
{
"@timestamp": "2016-12-26T16:15:55.103Z",
"apache2.error.module": "core",
"ecs.version": "1.0.0-beta2",
"event.dataset": "error",
"event.module": "apache2",
"input.type": "log",
"log.level": "notice",
"log.offset": 99,
"message": "AH00094: Command line: '/usr/local/Cellar/httpd24/2.4.23_2/bin/httpd'",
"@timestamp": "2016-12-26T16:15:55.103Z",
"apache2.error.module": "core",
"ecs.version": "1.0.0-beta2",
"event.dataset": "error",
"event.module": "apache2",
"input.type": "log",
"log.level": "notice",
"log.offset": 99,
"message": "AH00094: Command line: '/usr/local/Cellar/httpd24/2.4.23_2/bin/httpd'",
"process.pid": 11379
},
},
{
"@timestamp": "2011-09-09T10:42:29.902Z",
"apache2.error.module": "core",
"ecs.version": "1.0.0-beta2",
"event.dataset": "error",
"event.module": "apache2",
"input.type": "log",
"log.level": "error",
"log.offset": 229,
"message": "File does not exist: /usr/local/apache2/htdocs/favicon.ico",
"process.pid": 35708,
"process.thread.id": 4328636416,
"@timestamp": "2011-09-09T10:42:29.902Z",
"apache2.error.module": "core",
"ecs.version": "1.0.0-beta2",
"event.dataset": "error",
"event.module": "apache2",
"input.type": "log",
"log.level": "error",
"log.offset": 229,
"message": "File does not exist: /usr/local/apache2/htdocs/favicon.ico",
"process.pid": 35708,
"process.thread.id": 4328636416,
"source.address": "72.15.99.187"
}
]
94 changes: 47 additions & 47 deletions filebeat/module/auditd/log/test/test.log-expected.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
[
{
"@timestamp": "2017-01-31T20:17:14.891Z",
"auditd.log.auid": "4294967295",
"auditd.log.dst": "192.168.0.0",
"auditd.log.dst_prefixlen": "16",
"auditd.log.op": "SPD-delete",
"auditd.log.record_type": "MAC_IPSEC_EVENT",
"auditd.log.res": "1",
"auditd.log.sequence": 18877201,
"auditd.log.ses": "4294967295",
"auditd.log.src": "192.168.2.0",
"auditd.log.src_prefixlen": "24",
"ecs.version": "1.0.0-beta2",
"event.dataset": "log",
"event.module": "auditd",
"input.type": "log",
"@timestamp": "2017-01-31T20:17:14.891Z",
"auditd.log.auid": "4294967295",
"auditd.log.dst": "192.168.0.0",
"auditd.log.dst_prefixlen": "16",
"auditd.log.op": "SPD-delete",
"auditd.log.record_type": "MAC_IPSEC_EVENT",
"auditd.log.res": "1",
"auditd.log.sequence": 18877201,
"auditd.log.ses": "4294967295",
"auditd.log.src": "192.168.2.0",
"auditd.log.src_prefixlen": "24",
"ecs.version": "1.0.0-beta2",
"event.dataset": "log",
"event.module": "auditd",
"input.type": "log",
"log.offset": 0
},
},
{
"@timestamp": "2017-01-31T20:17:14.891Z",
"auditd.log.a0": "9",
"auditd.log.a1": "7f564b2672a0",
"auditd.log.a2": "b8",
"auditd.log.a3": "0",
"auditd.log.arch": "x86_64",
"auditd.log.auid": "4294967295",
"auditd.log.comm": "charon",
"auditd.log.egid": "0",
"auditd.log.euid": "0",
"auditd.log.exe": "/usr/libexec/strongswan/charon (deleted)",
"auditd.log.exit": "184",
"auditd.log.fsgid": "0",
"auditd.log.fsuid": "0",
"auditd.log.gid": "0",
"auditd.log.items": "0",
"auditd.log.pid": "1281",
"auditd.log.ppid": "1240",
"auditd.log.record_type": "SYSCALL",
"auditd.log.sequence": 18877199,
"auditd.log.ses": "4294967295",
"auditd.log.sgid": "0",
"auditd.log.success": "yes",
"auditd.log.suid": "0",
"auditd.log.syscall": "44",
"auditd.log.tty": "(none)",
"auditd.log.uid": "0",
"ecs.version": "1.0.0-beta2",
"event.dataset": "log",
"event.module": "auditd",
"input.type": "log",
"@timestamp": "2017-01-31T20:17:14.891Z",
"auditd.log.a0": "9",
"auditd.log.a1": "7f564b2672a0",
"auditd.log.a2": "b8",
"auditd.log.a3": "0",
"auditd.log.arch": "x86_64",
"auditd.log.auid": "4294967295",
"auditd.log.comm": "charon",
"auditd.log.egid": "0",
"auditd.log.euid": "0",
"auditd.log.exe": "/usr/libexec/strongswan/charon (deleted)",
"auditd.log.exit": "184",
"auditd.log.fsgid": "0",
"auditd.log.fsuid": "0",
"auditd.log.gid": "0",
"auditd.log.items": "0",
"auditd.log.pid": "1281",
"auditd.log.ppid": "1240",
"auditd.log.record_type": "SYSCALL",
"auditd.log.sequence": 18877199,
"auditd.log.ses": "4294967295",
"auditd.log.sgid": "0",
"auditd.log.success": "yes",
"auditd.log.suid": "0",
"auditd.log.syscall": "44",
"auditd.log.tty": "(none)",
"auditd.log.uid": "0",
"ecs.version": "1.0.0-beta2",
"event.dataset": "log",
"event.module": "auditd",
"input.type": "log",
"log.offset": 174
}
]
Loading

0 comments on commit bb92226

Please sign in to comment.