-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Manually prepare mysql package (alpha) #323
Merged
Merged
Changes from 5 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
dc7d138
Manually create mysql package (alpha)
b3f7222
Fix errors
baa94e5
Fix username, password
2d9c7c5
Update ingest pipeline
b4ffdfb
Address PR comments
ba1101e
Merge branch 'master' into package-mysql-0.0.2
1278b08
Fix: stream configuration
a080802
Fix: indent
b8cc5f1
Merge branch 'master' into package-mysql-0.0.2
9e37828
Update ingest pipeline
a8f23a4
Merge branch 'master' into package-mysql-0.0.2
a3b4bdf
Refresh imported
c2c91c4
Remove stale files
8e8bf18
Update package content
2dc52f5
Merge branch 'master' into package-mysql-0.0.2
ce4bdf0
Merge branch 'master' into package-mysql-0.0.2
549b3d0
Resolve conflict
460d8a3
Fix latest issues
c28c77c
Update docs with logged events
06867eb
Disable galera_status by default
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
dev/packages/alpha/mysql-0.0.2/dataset/error/agent/stream/stream.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
input: log | ||
paths: | ||
{{#each paths}} | ||
- {{this}} | ||
{{/each}} | ||
exclude_files: [".gz$"] | ||
multiline: | ||
# Consider lines without timestamp part of the previous message | ||
pattern: '^([0-9]{4}-[0-9]{2}-[0-9]{2}|[0-9]{6})' | ||
negate: true | ||
match: after | ||
processors: | ||
- add_locale: ~ |
65 changes: 65 additions & 0 deletions
65
dev/packages/alpha/mysql-0.0.2/dataset/error/elasticsearch/ingest-pipeline/default.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"description": "Pipeline for parsing MySQL error logs", | ||
"processors": [{ | ||
"grok": { | ||
"field": "message", | ||
"patterns": [ | ||
"%{MYSQLDATETIME}%{SPACE}(%{NUMBER:mysql.thread_id:long}%{SPACE})?(\\[%{DATA:log.level}\\]%{SPACE})?%{GREEDYMULTILINE:message}", | ||
"%{GREEDYDATA:message}" | ||
], | ||
"ignore_missing": true, | ||
"pattern_definitions": { | ||
"LOCALDATETIME": "(?:%{YEAR}-%{MONTHNUM}-%{MONTHDAY}|%{NUMBER})%{SPACE}%{TIME}", | ||
"MYSQLDATETIME": "(?:%{LOCALDATETIME:_tmp.local_timestamp}|%{TIMESTAMP_ISO8601:_tmp.timestamp})", | ||
"GREEDYMULTILINE": "(.|\n)+" | ||
} | ||
} | ||
}, { | ||
"rename": { | ||
"field": "@timestamp", | ||
"target_field": "event.created" | ||
} | ||
}, { | ||
"date": { | ||
"if": "ctx._tmp?.local_timestamp != null && ctx.event?.timezone == null", | ||
"field": "_tmp.local_timestamp", | ||
"formats": [ | ||
"yyMMdd H:m:s", | ||
"yyMMdd H:m:s", | ||
"yyyy-MM-dd H:m:s", | ||
"yyyy-MM-dd H:m:s" | ||
] | ||
} | ||
}, { | ||
"date": { | ||
"if": "ctx._tmp?.local_timestamp != null && ctx.event?.timezone != null", | ||
"field": "_tmp.local_timestamp", | ||
"timezone": "{{ event.timezone }}", | ||
"formats": [ | ||
"yyMMdd H:m:s", | ||
"yyMMdd H:m:s", | ||
"yyyy-MM-dd H:m:s", | ||
"yyyy-MM-dd H:m:s" | ||
] | ||
} | ||
}, { | ||
"date": { | ||
"if": "ctx._tmp?.timestamp != null", | ||
"field": "_tmp.timestamp", | ||
"formats": [ | ||
"ISO8601" | ||
] | ||
} | ||
}, { | ||
"remove":{ | ||
"field": "_tmp", | ||
"ignore_missing": true | ||
} | ||
}], | ||
"on_failure" : [{ | ||
"set" : { | ||
"field" : "error.message", | ||
"value" : "{{ _ingest.on_failure_message }}" | ||
} | ||
}] | ||
} |
17 changes: 17 additions & 0 deletions
17
dev/packages/alpha/mysql-0.0.2/dataset/error/fields/fields.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
- name: mysql.error | ||
type: group | ||
description: > | ||
Contains fields from the MySQL error logs. | ||
fields: | ||
- name: thread_id | ||
type: alias | ||
path: mysql.thread_id | ||
migration: true | ||
- name: level | ||
type: alias | ||
path: log.level | ||
migration: true | ||
- name: message | ||
type: alias | ||
path: message | ||
migration: true |
9 changes: 9 additions & 0 deletions
9
dev/packages/alpha/mysql-0.0.2/dataset/error/fields/package-fields.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- name: mysql | ||
type: group | ||
description: > | ||
Fields from the MySQL log files. | ||
fields: | ||
- name: thread_id | ||
type: long | ||
description: > | ||
The connection or thread ID for the query. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
title: MySQL error logs | ||
release: ga | ||
type: logs | ||
streams: | ||
- input: logs | ||
vars: | ||
- name: paths | ||
type: text | ||
title: Error log paths | ||
multi: true | ||
required: true | ||
show_user: true | ||
default: | ||
- /var/log/mysql/error.log* | ||
- /var/log/mysqld.log* | ||
os.darwin: | ||
default: | ||
- /usr/local/var/mysql/localhost.localdomain.err* | ||
os.windows: | ||
default: | ||
- c:/programdata/MySQL/MySQL Server*/error.log* | ||
title: MySQL error logs | ||
description: Collect MySQL error logs |
13 changes: 13 additions & 0 deletions
13
dev/packages/alpha/mysql-0.0.2/dataset/galera_status/agent/stream/stream.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
input: mysql/metrics | ||
metricsets: ["galera_status"] | ||
hosts: {{hosts}} | ||
{{#if password}} | ||
password: {{password}} | ||
{{/if}} | ||
period: {{period}} | ||
{{#if raw}} | ||
raw: {{raw}} | ||
{{/if}} | ||
{{#if username}} | ||
username: {{username}} | ||
{{/if}} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the migration field be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I'm not sure. If so, then probably that field should disappear at all from all entries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I meant here
thread_id
, the full block. I assumemysql.error.thread_id
does not exist anymore.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so this change will affect
fields.yml
and exported fields in README. I will work on this then, but it may take some time.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#327