fluent-plugin-rds-mysql-log 0.1.13 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77b346ae8c0eab97d93915d459002b6573a545b94f4fd2bba8bad896e3d866e8
4
- data.tar.gz: bada832355054a08bdba2eb4a093b2d2f82f6d3f6b9a7ab645dcdebfdec96cef
3
+ metadata.gz: 54c991b20601918e984e3e2dee1497ec124c34f6b863b2a8471a7374f7f9348c
4
+ data.tar.gz: c1d204feef35cc76be4eddcd5170a8574557e426032c52b35b633530de409e8c
5
5
  SHA512:
6
- metadata.gz: b20780f5f24d8b0ed76773e2d3c035be23cc6ef465523851346502e34428d5c777cd886946b05c793ec82e917bc9d40fdf185da3d1f002fa1dc69d3ae039406e
7
- data.tar.gz: 72f7f4a1919b610b36a27b18ce35268fa7f624ad169a528b9f58ae51bcdd459e0afe722bc45587999f2ccf2885d3439bac055f5b171949dbd9bd16c86a5ca86d
6
+ metadata.gz: 876326aab54f3721db478d99099ac11f19ae9f4027b5b05508764d7b67815993662325cbed183b35153240a808e21d797ed82f60acbf8efdbbbbfab166be44f7
7
+ data.tar.gz: 7f48a11eb591a1439dadd726bedfc1207669bca3f33839fe658de11c972bb56567342d48941dd35e793ee993e39e5ed59cf7a75b7a5e716f8e69b1beace23191
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'fluent-plugin-rds-mysql-log'
8
- spec.version = '0.1.13'
8
+ spec.version = '0.1.14'
9
9
  spec.authors = ['Junaid Ali']
10
10
  spec.email = ['jonnie36@yahoo.com']
11
11
  spec.summary = 'Amazon RDS Mysql logs input plugin'
@@ -8,6 +8,7 @@ class Fluent::Plugin::RdsMysqlLogInput < Fluent::Plugin::Input
8
8
  helpers :timer
9
9
 
10
10
  LOG_REGEXP = /^(?:(?<audit_logs>(?<timestamp>(\d{8})\s(\d{2}:\d{2}:\d{2})?),(?<serverhost>[^,]+?),(?<username>[^,]+?),(?<host>[^,]+?),(?<connectionid>[^,]+?),(?<queryid>[^,]+?),(?<operation>[^,]+?),(?<database>[^,]+?),'(?<query>.*?)',(?<retcode>[0-9]?),(?:,)?)|(?<other_logs>(?<time>(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}\.\d+Z)?)\s(?<thread_id>\d+?)\s\[(?<severity>([^\]]+)?)\]\s\[(?<error_code>([^\]]+)?)\]\s\[(?<subsystem>([^\]]+)?)\]\s((?<message>.+)?)))$/m
11
+ AUDIT_LOG_PATTERN = /server_audit\.log(\.\d+)?$/i
11
12
 
12
13
  config_param :access_key_id, :string, :default => nil
13
14
  config_param :secret_access_key, :string, :default => nil
@@ -75,6 +76,10 @@ class Fluent::Plugin::RdsMysqlLogInput < Fluent::Plugin::Input
75
76
  end
76
77
  end
77
78
 
79
+ def is_audit_logs?
80
+ @pos_info.keys.any? { |log_file_name| log_file_name =~ AUDIT_LOG_PATTERN }
81
+ end
82
+
78
83
  def should_track_marker?(log_file_name)
79
84
  return false if log_file_name == "audit/server_audit.log"
80
85
 
@@ -117,11 +122,18 @@ class Fluent::Plugin::RdsMysqlLogInput < Fluent::Plugin::Input
117
122
  begin
118
123
  log.debug "get logfile-list from rds: db_instance_identifier=#{@db_instance_identifier}, pos_last_written_timestamp=#{@pos_last_written_timestamp}"
119
124
 
120
- @rds.describe_db_log_files(
121
- db_instance_identifier: @db_instance_identifier,
122
- file_last_written: @pos_last_written_timestamp,
123
- max_records: 10,
124
- )
125
+ if is_audit_logs?
126
+ @rds.describe_db_log_files(
127
+ db_instance_identifier: @db_instance_identifier,
128
+ max_records: 10
129
+ )
130
+ else
131
+ @rds.describe_db_log_files(
132
+ db_instance_identifier: @db_instance_identifier,
133
+ file_last_written: @pos_last_written_timestamp,
134
+ max_records: 10,
135
+ )
136
+ end
125
137
  rescue => e
126
138
  log.warn "RDS Client describe_db_log_files error occurred: #{e.message}"
127
139
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-rds-mysql-log
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Junaid Ali