From e8e82ec3be270076b0751174bf28e207b754a611 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Fri, 18 Jan 2019 11:38:23 +0100 Subject: [PATCH] Rename thread id fields in filebeat module for mysql Several ids in the filebeat module for mysql are named differently but they all refer to thread (or connection) ids. They are internal mysql ids that don't map to operating system processes or threads. Use `mysql.thread_id` for these ids. Also remove timestamp fields after converting them to dates. --- CHANGELOG.next.asciidoc | 2 ++ dev-tools/ecs-migration.yml | 6 +++- filebeat/docs/fields.asciidoc | 35 +++++++------------ filebeat/module/mysql/_meta/fields.yml | 4 +++ filebeat/module/mysql/error/_meta/fields.yml | 6 +--- .../module/mysql/error/ingest/pipeline.json | 7 +++- .../mysql/error/test/error.log-expected.json | 25 ++++--------- filebeat/module/mysql/fields.go | 2 +- .../module/mysql/slowlog/_meta/fields.yml | 10 ++---- .../module/mysql/slowlog/ingest/pipeline.json | 7 +++- .../test/mariadb-10.1.21.log-expected.json | 3 +- .../test/mariadb-10.2.12.log-expected.json | 6 ++-- .../test/mariadb-explain.log-expected.json | 3 +- .../test/mysql-5.7.22.log-expected.json | 10 ++---- 14 files changed, 55 insertions(+), 71 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 6d42ee36d06..d52117ba847 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -42,6 +42,8 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Add grok pattern to support redis 5.0.3 log timestamp. {issue}9819[9819] {pull}10033[10033] - Now save the 'first seen' timestamp in `event.created` (previously `read_timestamp`), instead of saving the parsed date. Now aligned with `event.created` semantics elsewhere. {pull}10139[10139] +- Rename `mysql.error.thread_id` and `mysql.slowlog.id` to `mysql.thread_id`. {pull}10161[10161] +- Remove `mysql.error.timestamp` and `mysql.slowlog.timestamp`. {pull}10161[10161] *Heartbeat* diff --git a/dev-tools/ecs-migration.yml b/dev-tools/ecs-migration.yml index 0bdbfdf10a1..c7d6afe508e 100644 --- a/dev-tools/ecs-migration.yml +++ b/dev-tools/ecs-migration.yml @@ -551,7 +551,7 @@ alias: true - from: mysql.error.thread_id - to: process.thread.id + to: mysql.thread_id alias: true - from: mysql.slowlog.ip @@ -566,6 +566,10 @@ to: user.name alias: true +- from: mysql.slowlog.id + to: mysql.thread_id + alias: true + ## NGINX module - from: nginx.access.user_name diff --git a/filebeat/docs/fields.asciidoc b/filebeat/docs/fields.asciidoc index 9711da595ff..b89806d781a 100644 --- a/filebeat/docs/fields.asciidoc +++ b/filebeat/docs/fields.asciidoc @@ -6322,27 +6322,29 @@ Fields from the MySQL log files. -[float] -== error fields - -Contains fields from the MySQL error logs. +*`mysql.thread_id`*:: ++ +-- +type: long +The connection or thread ID for the query. -*`mysql.error.timestamp`*:: -+ -- -The timestamp from the log line. + +[float] +== error fields + +Contains fields from the MySQL error logs. --- *`mysql.error.thread_id`*:: + -- type: alias -alias to: process.thread.id +alias to: mysql.thread_id -- @@ -6419,16 +6421,6 @@ type: long The number of rows modified by the query. --- - -*`mysql.slowlog.timestamp`*:: -+ --- -type: long - -The unix timestamp taken from the `SET timestamp` query. - - -- *`mysql.slowlog.query`*:: @@ -6442,10 +6434,9 @@ The slow query. *`mysql.slowlog.id`*:: + -- -type: long - -The connection or thread ID for the query. +type: alias +alias to: mysql.thread_id -- diff --git a/filebeat/module/mysql/_meta/fields.yml b/filebeat/module/mysql/_meta/fields.yml index 62763f8d463..59cc658481f 100644 --- a/filebeat/module/mysql/_meta/fields.yml +++ b/filebeat/module/mysql/_meta/fields.yml @@ -9,3 +9,7 @@ description: > Fields from the MySQL log files. fields: + - name: thread_id + type: long + description: > + The connection or thread ID for the query. diff --git a/filebeat/module/mysql/error/_meta/fields.yml b/filebeat/module/mysql/error/_meta/fields.yml index 39a7949da7d..a4ad44ef2fb 100644 --- a/filebeat/module/mysql/error/_meta/fields.yml +++ b/filebeat/module/mysql/error/_meta/fields.yml @@ -3,13 +3,9 @@ description: > Contains fields from the MySQL error logs. fields: - - name: timestamp - description: > - The timestamp from the log line. - - name: thread_id type: alias - path: process.thread.id + path: mysql.thread_id migration: true - name: level type: alias diff --git a/filebeat/module/mysql/error/ingest/pipeline.json b/filebeat/module/mysql/error/ingest/pipeline.json index a541ed29aa0..0c77ca01cbf 100644 --- a/filebeat/module/mysql/error/ingest/pipeline.json +++ b/filebeat/module/mysql/error/ingest/pipeline.json @@ -5,7 +5,7 @@ "field": "message", "patterns": [ "%{LOCALDATETIME:mysql.error.timestamp} (\\[%{DATA:log.level}\\] )?%{GREEDYDATA:message}", - "%{DATA:mysql.error.timestamp} %{NUMBER:process.thread.id:long} \\[%{DATA:log.level}\\] %{GREEDYDATA:message}", + "%{DATA:mysql.error.timestamp} %{NUMBER:mysql.thread_id:long} \\[%{DATA:log.level}\\] %{GREEDYDATA:message}", "%{GREEDYDATA:message}" ], "ignore_missing": true, @@ -28,6 +28,11 @@ ], "ignore_failure": true } + }, { + "remove":{ + "field": "mysql.error.timestamp", + "ignore_missing": true + } }], "on_failure" : [{ "set" : { diff --git a/filebeat/module/mysql/error/test/error.log-expected.json b/filebeat/module/mysql/error/test/error.log-expected.json index 59ecbd65a01..486756d8a26 100644 --- a/filebeat/module/mysql/error/test/error.log-expected.json +++ b/filebeat/module/mysql/error/test/error.log-expected.json @@ -8,7 +8,6 @@ "input.type": "log", "log.offset": 0, "message": "mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql", - "mysql.error.timestamp": "161209 13:08:33", "service.type": "mysql" }, { @@ -21,8 +20,7 @@ "log.level": "Warning", "log.offset": 92, "message": "TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).", - "mysql.error.timestamp": "2016-12-09T12:08:33.335060Z", - "process.thread.id": 0, + "mysql.thread_id": 0, "service.type": "mysql" }, { @@ -35,8 +33,7 @@ "log.level": "Warning", "log.offset": 282, "message": "Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.", - "mysql.error.timestamp": "2016-12-09T12:08:33.335892Z", - "process.thread.id": 0, + "mysql.thread_id": 0, "service.type": "mysql" }, { @@ -49,8 +46,7 @@ "log.level": "Note", "log.offset": 478, "message": "/usr/local/Cellar/mysql/5.7.10/bin/mysqld (mysqld 5.7.10) starting as process 61571 ...", - "mysql.error.timestamp": "2016-12-09T12:08:33.336610Z", - "process.thread.id": 0, + "mysql.thread_id": 0, "service.type": "mysql" }, { @@ -63,8 +59,7 @@ "log.level": "Warning", "log.offset": 603, "message": "Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive", - "mysql.error.timestamp": "2016-12-09T12:08:33.345527Z", - "process.thread.id": 0, + "mysql.thread_id": 0, "service.type": "mysql" }, { @@ -77,8 +72,7 @@ "log.level": "Note", "log.offset": 742, "message": "InnoDB: Mutexes and rw_locks use GCC atomic builtins", - "mysql.error.timestamp": "2016-12-09T12:08:33.351596Z", - "process.thread.id": 0, + "mysql.thread_id": 0, "service.type": "mysql" }, { @@ -91,8 +85,7 @@ "log.level": "Note", "log.offset": 832, "message": "/usr/local/Cellar/mysql/5.7.10/bin/mysqld: ready for connections.", - "mysql.error.timestamp": "2016-12-09T12:08:33.784722Z", - "process.thread.id": 0, + "mysql.thread_id": 0, "service.type": "mysql" }, { @@ -115,8 +108,7 @@ "log.level": "Note", "log.offset": 1002, "message": "InnoDB: page_cleaner: 1000ms intended loop took 772568ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)", - "mysql.error.timestamp": "2016-12-09T22:21:02.443689Z", - "process.thread.id": 0, + "mysql.thread_id": 0, "service.type": "mysql" }, { @@ -129,7 +121,6 @@ "log.level": "Warning", "log.offset": 1176, "message": "Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.", - "mysql.error.timestamp": "161209 14:18:50", "service.type": "mysql" }, { @@ -142,7 +133,6 @@ "log.level": "Note", "log.offset": 1367, "message": "Plugin 'FEDERATED' is disabled.", - "mysql.error.timestamp": "161209 14:18:50", "service.type": "mysql" }, { @@ -154,7 +144,6 @@ "input.type": "log", "log.offset": 1422, "message": "InnoDB: The InnoDB memory heap is disabled", - "mysql.error.timestamp": "161209 14:18:50", "service.type": "mysql" } ] \ No newline at end of file diff --git a/filebeat/module/mysql/fields.go b/filebeat/module/mysql/fields.go index 2ac249397f2..8825a56ce11 100644 --- a/filebeat/module/mysql/fields.go +++ b/filebeat/module/mysql/fields.go @@ -31,5 +31,5 @@ func init() { // Asset returns asset data func Asset() string { - return "eJy0l8GO4zYMhu95CmJPLbCbB8ihl2kLFOgWKHaBHr2MRNtsZNEjycmkT19QTuJsYmcm2bEOc4iG/D9SIil/gg3tV9Ds47NbACROjlbw4fP+y99/flgAWIomcJtY/Ap+WQAAfBbbOYJSArQYIvsKUk2QTcBJBSU7issFQKwlpMKIL7laQQodLQBKJmfjKrv6BB4bGuR1pX1LK6iCdO3hlxEGXb9nR1AGaaYAdJ3rnWtSCBJOv47p3tDW9SQ+Ift4ULgEyf4V50QyRnNOlLihmLBpv9u9yaDra02D6UChiXDsaVAfF60DoS3YXvjt04GOMV7stJjqFbRBDMW47O2XV/YNVwF75MPBX2s72pK7U9dJtRyze4teQzFiRXcqjltN6R21opOdk2rGC6YKd92v547CvtCrsoxkRrNQOsH0wPWThC5fwsyXhSCJbD4Ce4hkxNv4ETAC9hLaNFphn8B3zZrCcvx+iNnMwouNdD6BlJfMO+RENve2vobMBpLAmgC3yA7Xjpbq4crrFl1HwPGH4g2yi0UkfxlRH6sTX90faq+noap3CJS64MnCej+EfYOGXrBhT+Pd4V2IokF/BxCWJZk0J1Ajlkt+E9FUx/4Rms7zy1k/T7ghP5T+ty+/fR12v92Cy1v36+e2csPtxKR4LFgj3pPR/4BccjpL4I9fTwV4gyOamhocZdnQfifhkvMtsWefsKsp9F1hSAbsMAK9kOkS2XEi04VAPhVdpPB+XE+9V8Au1eQTG9QOpRof9a/V/mQpUdA6BTQ6laENvGVHFcUlPKEHy2VJYbhGfbvSLKujV54I/dwwaGoqah5vTmsRR+jvC+2fmlJNZycNWSSnuuY0UXNNWyRtxO/PgZCoaSWgTi+VyCTHJAeK4rb0ak848hXiC8txM2e+PJFVuu+xI4geedyME+bnsYQZDvLoGaRN3PB/+YF0SuJtmvnSdZsK0Fvg9Fgq28ASOO2L5466WW7kUQGywkCttXsMbCKxnXOFTtc5sNT5oUZUInMdMnjs3a8Nksz3r/B8fOr8Nhn85AXYW3qhCDvt+qfkqnH8eRy9oVBR0WKMdPnN8Og0/Ov0CMnOoXd+mjhTE3EUb3IATX/k5DGg1g98VtUSx3vJtFyULhhaWmnw6vzfIsnjL65XBa/sLsX+DwAA///cNZmy" + return "eJzEV82O8zYMvOcpiO/UAvv5AXLoZYsCBfoVKFqgR4ORaJuNLHpFOdn06Qspv3XsbJKuUR1ysMCZ4Ugkla+wpt0S2p2+uQVA5OhoCV++7X7/7ZcvCwBLagJ3kcUv4YcFAMA3sb0jqCRAh0HZ1xAbghwCTmqo2JEWCwBtJMTSiK+4XkIMPS0AKiZndZmhvoLHls70acVdR0uog/Td4cuIhrR+ykBQBWmnBKR1yXfJGZtAaEu2p50jtxNfX3ycoE/rj4bAiPdk0i5IOKDCzz9mf5Kst57CrriipxAkXFFfpv0B96v4iOz1kODQh4yf3NDiImxoxkeGnJWhY9TBToexORxeMRXdch1wr/9wAa6ZHW3IPcjqpC7G4u7ha0kVa3o0z9GoKb4jlzrZOqlnPOnE8NBB5xtZRm6pUDKjLlROMA52biiEQy1EieggIZ+vPkSR9QuwByUj3uoLoALuKVLz6IR9BN+3KwrF+P0Qs55FL7bS+whSDTVvkSPZUw0nARAFVgS4QXa4clQkhCvUDbqegPU/5Rtkq6WSH2Y02p7uTHXPl1JN6BAo9sGThdVurEtdqaF3bNnTeG/4FEVq0D8gCKuKTJxTUCuWK75LUd56nDBX7g3Y/6EVq2moxVHaNe22Eoag96SZMWHbUNjX2Dlv2KICvZPpI9lxE0wfAvlY9krh83S97lEB+9iQj2ww1XvieEm/NlW7pUgh3XpAY0gVusAbdlSTFvCKHixXFYVzP94Xf2oaCeiczo0ubNA0VDY8XuorEUfoH0vtz4ZiQxePD8gk2eqG47jLse3KmNra5+tAiNR2EjDNgkSRlRxNDqTiNvRRhZ30leJLy7qe0y9PZJO6f8tWkHTkuh5XmB+dEmY4yCMySBe55b9zDZ9MvK1mPrtuqwL0Fjg+Z2UXWALHXfnWUz/LjTwyQGY4q061e0xswtjeuTLNqjlkJfBDjSSKrOvg4PEp8tHMyPr+Ep5PXwK/rQy+8wLsLb2TwjZ1/ZO5KVi/H5feUqip7FCVhuPt2bH+62mkZ3DYg58mztSftFF5kwNoeh7nMZCin5jEjeh4L5mmU+mDocJKi1fnfw8ld88RXsUNyf4JAAD//zJjbbQ=" } diff --git a/filebeat/module/mysql/slowlog/_meta/fields.yml b/filebeat/module/mysql/slowlog/_meta/fields.yml index 64abf9085c3..38147609ba9 100644 --- a/filebeat/module/mysql/slowlog/_meta/fields.yml +++ b/filebeat/module/mysql/slowlog/_meta/fields.yml @@ -24,17 +24,13 @@ type: long description: > The number of rows modified by the query. - - name: timestamp - type: long - description: > - The unix timestamp taken from the `SET timestamp` query. - name: query description: > The slow query. - name: id - type: long - description: > - The connection or thread ID for the query. + type: alias + path: mysql.thread_id + migration: true - name: schema type: keyword description: > diff --git a/filebeat/module/mysql/slowlog/ingest/pipeline.json b/filebeat/module/mysql/slowlog/ingest/pipeline.json index 0f9e224d5cc..9d517d30535 100644 --- a/filebeat/module/mysql/slowlog/ingest/pipeline.json +++ b/filebeat/module/mysql/slowlog/ingest/pipeline.json @@ -4,7 +4,7 @@ "grok": { "field": "message", "patterns":[ - "^# User@Host: %{USER:user.name}(\\[%{USER:mysql.slowlog.current_user}\\])? @ %{HOSTNAME:source.domain}? \\[%{IP:source.ip}?\\](\\s*Id:\\s* %{NUMBER:mysql.slowlog.id:long})?\n(# Thread_id:%{SPACE}%{NUMBER:mysql.slowlog.id}%{METRICSPACE}Schema: %{WORD:mysql.slowlog.schema}?%{METRICSPACE}QC_hit: %{WORD:mysql.slowlog.query_cache_hit}\n)?%{METRICSPACE}Query_time: %{NUMBER:mysql.slowlog.query_time.sec:float}%{METRICSPACE}Lock_time: %{NUMBER:mysql.slowlog.lock_time.sec:float}%{METRICSPACE}Rows_sent: %{NUMBER:mysql.slowlog.rows_sent:long}%{METRICSPACE}Rows_examined: %{NUMBER:mysql.slowlog.rows_examined:long}%{METRICSPACE}(Rows_affected: %{NUMBER:mysql.slowlog.rows_affected:long}%{METRICSPACE})?(Full_scan: %{WORD:mysql.slowlog.full_scan}%{METRICSPACE})?(Full_join: %{WORD:mysql.slowlog.full_join}%{METRICSPACE})?(Tmp_table: %{WORD:mysql.slowlog.tmp_table}%{METRICSPACE})?(Tmp_table_on_disk: %{WORD:mysql.slowlog.tmp_table_on_disk}%{METRICSPACE})?(Filesort: %{WORD:mysql.slowlog.filesort}%{METRICSPACE})?(Filesort_on_disk: %{WORD:mysql.slowlog.filesort_on_disk}%{METRICSPACE})?(Merge_passes: %{NUMBER:mysql.slowlog.merge_passes}%{METRICSPACE})?(Priority_queue: %{WORD:mysql.slowlog.priority_queue}%{METRICSPACE})?%{EXPLAIN}?(use %{WORD:mysql.slowlog.schema};\n)?SET timestamp=%{NUMBER:mysql.slowlog.timestamp:long};\n%{GREEDYMULTILINE:mysql.slowlog.query}" + "^# User@Host: %{USER:user.name}(\\[%{USER:mysql.slowlog.current_user}\\])? @ %{HOSTNAME:source.domain}? \\[%{IP:source.ip}?\\](\\s*Id:\\s* %{NUMBER:mysql.thread_id:long})?\n(# Thread_id:%{SPACE}%{NUMBER:mysql.thread_id}%{METRICSPACE}Schema: %{WORD:mysql.slowlog.schema}?%{METRICSPACE}QC_hit: %{WORD:mysql.slowlog.query_cache_hit}\n)?%{METRICSPACE}Query_time: %{NUMBER:mysql.slowlog.query_time.sec:float}%{METRICSPACE}Lock_time: %{NUMBER:mysql.slowlog.lock_time.sec:float}%{METRICSPACE}Rows_sent: %{NUMBER:mysql.slowlog.rows_sent:long}%{METRICSPACE}Rows_examined: %{NUMBER:mysql.slowlog.rows_examined:long}%{METRICSPACE}(Rows_affected: %{NUMBER:mysql.slowlog.rows_affected:long}%{METRICSPACE})?(Full_scan: %{WORD:mysql.slowlog.full_scan}%{METRICSPACE})?(Full_join: %{WORD:mysql.slowlog.full_join}%{METRICSPACE})?(Tmp_table: %{WORD:mysql.slowlog.tmp_table}%{METRICSPACE})?(Tmp_table_on_disk: %{WORD:mysql.slowlog.tmp_table_on_disk}%{METRICSPACE})?(Filesort: %{WORD:mysql.slowlog.filesort}%{METRICSPACE})?(Filesort_on_disk: %{WORD:mysql.slowlog.filesort_on_disk}%{METRICSPACE})?(Merge_passes: %{NUMBER:mysql.slowlog.merge_passes}%{METRICSPACE})?(Priority_queue: %{WORD:mysql.slowlog.priority_queue}%{METRICSPACE})?%{EXPLAIN}?(use %{WORD:mysql.slowlog.schema};\n)?SET timestamp=%{NUMBER:mysql.slowlog.timestamp:long};\n%{GREEDYMULTILINE:mysql.slowlog.query}" ], "pattern_definitions" : { "GREEDYMULTILINE": "(.|\n)*", @@ -51,6 +51,11 @@ "formats": ["UNIX"], "ignore_failure": true } + }, { + "remove":{ + "field": "mysql.slowlog.timestamp", + "ignore_missing": true + } }, { "gsub": { "field": "mysql.slowlog.query", diff --git a/filebeat/module/mysql/slowlog/test/mariadb-10.1.21.log-expected.json b/filebeat/module/mysql/slowlog/test/mariadb-10.1.21.log-expected.json index bbeb1870112..3e979082548 100644 --- a/filebeat/module/mysql/slowlog/test/mariadb-10.1.21.log-expected.json +++ b/filebeat/module/mysql/slowlog/test/mariadb-10.1.21.log-expected.json @@ -12,14 +12,13 @@ ], "log.offset": 24, "mysql.slowlog.current_user": "root", - "mysql.slowlog.id": "5", "mysql.slowlog.lock_time.sec": 0.0, "mysql.slowlog.query": "select sleep(2);", "mysql.slowlog.query_cache_hit": false, "mysql.slowlog.query_time.sec": 2.000652, "mysql.slowlog.rows_examined": 0, "mysql.slowlog.rows_sent": 1, - "mysql.slowlog.timestamp": 1528898676, + "mysql.thread_id": "5", "service.type": "mysql", "source.domain": "localhost", "source.ip": "121.0.0.1", diff --git a/filebeat/module/mysql/slowlog/test/mariadb-10.2.12.log-expected.json b/filebeat/module/mysql/slowlog/test/mariadb-10.2.12.log-expected.json index 8517b4a6fda..6517ef123f2 100644 --- a/filebeat/module/mysql/slowlog/test/mariadb-10.2.12.log-expected.json +++ b/filebeat/module/mysql/slowlog/test/mariadb-10.2.12.log-expected.json @@ -12,7 +12,6 @@ ], "log.offset": 437, "mysql.slowlog.current_user": "root", - "mysql.slowlog.id": "8", "mysql.slowlog.lock_time.sec": 0.0, "mysql.slowlog.query": "select sleep(2)\nAS foo;", "mysql.slowlog.query_cache_hit": false, @@ -20,7 +19,7 @@ "mysql.slowlog.rows_affected": 0, "mysql.slowlog.rows_examined": 0, "mysql.slowlog.rows_sent": 1, - "mysql.slowlog.timestamp": 1547741043, + "mysql.thread_id": "8", "service.type": "mysql", "source.domain": "localhost", "user.name": "root" @@ -42,7 +41,6 @@ "mysql.slowlog.filesort_on_disk": false, "mysql.slowlog.full_join": false, "mysql.slowlog.full_scan": true, - "mysql.slowlog.id": "25844", "mysql.slowlog.lock_time.sec": 0.0, "mysql.slowlog.merge_passes": "0", "mysql.slowlog.priority_queue": false, @@ -53,9 +51,9 @@ "mysql.slowlog.rows_examined": 53022772, "mysql.slowlog.rows_sent": 0, "mysql.slowlog.schema": "blah", - "mysql.slowlog.timestamp": 1547741058, "mysql.slowlog.tmp_table": true, "mysql.slowlog.tmp_table_on_disk": false, + "mysql.thread_id": "25844", "service.type": "mysql", "source.ip": "192.168.0.10", "user.name": "root" diff --git a/filebeat/module/mysql/slowlog/test/mariadb-explain.log-expected.json b/filebeat/module/mysql/slowlog/test/mariadb-explain.log-expected.json index 562e9317c92..40ee56904bd 100644 --- a/filebeat/module/mysql/slowlog/test/mariadb-explain.log-expected.json +++ b/filebeat/module/mysql/slowlog/test/mariadb-explain.log-expected.json @@ -12,7 +12,6 @@ ], "log.offset": 24, "mysql.slowlog.current_user": "root", - "mysql.slowlog.id": "2", "mysql.slowlog.lock_time.sec": 0.000337, "mysql.slowlog.query": "select count(*) from customer, orders, nation\n where c_custkey=o_custkey\n and c_nationkey=n_nationkey\n and n_name='GERMANY';", "mysql.slowlog.query_cache_hit": false, @@ -20,7 +19,7 @@ "mysql.slowlog.rows_examined": 65633, "mysql.slowlog.rows_sent": 1, "mysql.slowlog.schema": "dbt3sf1", - "mysql.slowlog.timestamp": 1384261412, + "mysql.thread_id": "2", "service.type": "mysql", "source.domain": "localhost", "user.name": "root" diff --git a/filebeat/module/mysql/slowlog/test/mysql-5.7.22.log-expected.json b/filebeat/module/mysql/slowlog/test/mysql-5.7.22.log-expected.json index 1c675dd94c2..68c950eefc6 100644 --- a/filebeat/module/mysql/slowlog/test/mysql-5.7.22.log-expected.json +++ b/filebeat/module/mysql/slowlog/test/mysql-5.7.22.log-expected.json @@ -12,13 +12,12 @@ ], "log.offset": 41, "mysql.slowlog.current_user": "root", - "mysql.slowlog.id": 7234, "mysql.slowlog.lock_time.sec": 0.0, "mysql.slowlog.query": "select sleep(15);", "mysql.slowlog.query_time.sec": 15.000223, "mysql.slowlog.rows_examined": 0, "mysql.slowlog.rows_sent": 1, - "mysql.slowlog.timestamp": 1533630467, + "mysql.thread_id": 7234, "service.type": "mysql", "source.ip": "218.76.8.37", "user.name": "root" @@ -41,7 +40,6 @@ "mysql.slowlog.query_time.sec": 0.000153, "mysql.slowlog.rows_examined": 5, "mysql.slowlog.rows_sent": 1, - "mysql.slowlog.timestamp": 1533630467, "service.type": "mysql", "source.domain": "localhost", "user.name": "debian-sys-maint" @@ -59,13 +57,12 @@ ], "log.offset": 526, "mysql.slowlog.current_user": "appuser", - "mysql.slowlog.id": 10997316, "mysql.slowlog.lock_time.sec": 0.000212, "mysql.slowlog.query": "SELECT mcu.mcu_guid, mcu.cus_guid, mcu.mcu_url, mcu.mcu_crawlelements, mcu.mcu_order, GROUP_CONCAT(mca.mca_guid SEPARATOR \";\") as mca_guid\n FROM kat_mailcustomerurl mcu, kat_customer cus, kat_mailcampaign mca\n WHERE cus.cus_guid = mcu.cus_guid\n AND cus.pro_code = 'CYB'\n AND cus.cus_offline = 0\n AND mca.cus_guid = cus.cus_guid\n AND (mcu.mcu_date IS NULL OR mcu.mcu_date < CURDATE())\n AND mcu.mcu_crawlelements IS NOT NULL\n GROUP BY mcu.mcu_guid\n ORDER BY mcu.mcu_order ASC\n LIMIT 1000;", "mysql.slowlog.query_time.sec": 4.071491, "mysql.slowlog.rows_examined": 1489615, "mysql.slowlog.rows_sent": 1000, - "mysql.slowlog.timestamp": 1533630467, + "mysql.thread_id": 10997316, "service.type": "mysql", "source.domain": "apphost", "source.ip": "1.1.1.1", @@ -84,13 +81,12 @@ ], "log.offset": 1438, "mysql.slowlog.current_user": "appuser", - "mysql.slowlog.id": 10999834, "mysql.slowlog.lock_time.sec": 3.6e-05, "mysql.slowlog.query": "call load_stats(1, '2017-04-28 00:00:00');", "mysql.slowlog.query_time.sec": 10.346539, "mysql.slowlog.rows_examined": 4751313, "mysql.slowlog.rows_sent": 0, - "mysql.slowlog.timestamp": 1533630467, + "mysql.thread_id": 10999834, "service.type": "mysql", "source.domain": "apphost", "source.ip": "1.1.1.1",