-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
INS-26353 [Offset fix for MariaDB OnPrem]
Signed-off-by: Apurva-Birajdar <[email protected]>
- Loading branch information
1 parent
707e057
commit 769f516
Showing
6 changed files
with
37 additions
and
30 deletions.
There are no files selected for viewing
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
17 changes: 9 additions & 8 deletions
17
...er-plugin/logstash-filter-mariadb-guardium/MariaDBOverFilebeatPackage/MariaDB/filter.conf
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 |
---|---|---|
@@ -1,30 +1,31 @@ | ||
filter{ | ||
if [type] == "filebeat" and "guc_filter_param_datasource_tag" in [tags] { | ||
if [type] == "mariadb" and "guc_filter_param_datasource_tag" in [tags]{ | ||
mutate { | ||
add_field => {"server_Ip" => "%{[host][ip][0]}"} | ||
} | ||
mutate {add_field => { "TZ" => "%{[event][timezone]}" }} | ||
mutate {add_field => { "Offset" => "%{[event][timezone]}" }} | ||
|
||
# In case of duplicate records enable add_id feature in Filebeat configuration and uncomment below mentioned lines replacing event_id and _id. | ||
|
||
#mutate { | ||
# replace => { "event_id" => "%{[@metadata][_id]}"} | ||
# replace => { "_id" => "%{[@metadata][_id]}"} | ||
#} | ||
|
||
grok { match => { "TZ" => "(?<minutes>[^:]*):(?<seconds>[^,]*)" } } | ||
grok { match => { "minutes" => "(?<offset_diff>[^[0-9]]*)%{GREEDYDATA:actual_minutes}" } }ruby { code => "event.set('minutes1', event.get('actual_minutes').to_i * 60)" } | ||
ruby { code => "event.set('offset1', event.get('minutes1') + event.get('seconds').to_i)" }mutate { add_field => { "totalOffset" => "%{offset_diff}%{offset1}" } } | ||
grok | ||
{ | ||
match => {"message" => "(?<timestamp>[^[A-Z][a-z]]*),(?<serverhost>[^\s]*),(?<username>[^\s]*),(?<hostname>[^\s]*),(?<connectionid>[^\s]*),(?<queryid>[^\s]*),(?<operation>[^\s]*),(?<database>[^\s]*),(?:%{GREEDYDATA:object}),(?<retcode>[^\s]*)"} | ||
} | ||
# This is to ignore system logs which are having correct format but database name is missing. | ||
# create database command is exception thats why excluded from this condition. | ||
if "QUERY" == [operation] and "0" == [retcode] and ![database] and "create database" not in [message]{ | ||
drop{} | ||
} | ||
# The "FAILED_CONNECT" system generated logs is appearing multiple time, which doesn't have any relation with authentication log. | ||
# so ignoring it. | ||
if "FAILED_CONNECT" == [operation] and "0" == [queryid] and ![username]{ | ||
drop{} | ||
} | ||
mariadb_guardium_filter{} | ||
} | ||
} | ||
} |
Binary file modified
BIN
+79.6 KB
(100%)
...b-guardium/MariaDBOverFilebeatPackage/MariaDB/logstash-filter-mariadb_guardium_filter.zip
Binary file not shown.
8 changes: 5 additions & 3 deletions
8
filter-plugin/logstash-filter-mariadb-guardium/mariadb-test.conf
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
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
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