fluent-plugin-postgresql-csvlog 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38090772bf1e0302ecd53d759d8da4ffb2df0cdf0a6f001ec0e0d12390472276
4
- data.tar.gz: 22bc8479b81f0b0fd7615cfb6cc1b491b317fc74d612f21373243a516e671be4
3
+ metadata.gz: 5fd63aaf4685f342a67b1ae1393d6f0ab7c4fab2d76b0e1b8f65a20d544c7fbf
4
+ data.tar.gz: faca443f2ff5b0bba6baa960918619e21ba03d86055cbb6a38d27278e56d903c
5
5
  SHA512:
6
- metadata.gz: c3ecfef7d3290ab00a71613c7914c0aae1d05501d37574614d9d6f4a2f5de9548474ecb7b6fdad4ef778c4ea48510a1e31a89294e317ecf7ab6004e094579cc9
7
- data.tar.gz: 2b91a1704d53f07ab5139bc2d623c0c17afde53b416ef5f018dd7e6d345ce8a8da1d0aa8964bcef638b8e6ab351b2d7c16b83be73cbdcfba560dda69962bdd17
6
+ metadata.gz: de5e28ed56dc6fcfeb7f0631538e796561556cadd3d5b03a3510cd4f575291c51bf9c335d1f49415569a7c8bdd217e1cb22a411258fe6cbeed023cad15cb2232
7
+ data.tar.gz: 176678ab47f25823b1dbce6bec33e4d86ee5c02ae72a7370541d399d91a0aa79cd9b575fb4a75a3fe53f0cf4400b7b55cd0102e071de7c52279e6b936f03ec20
@@ -2,7 +2,7 @@ $:.push File.expand_path('lib', __dir__)
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'fluent-plugin-postgresql-csvlog'
5
- s.version = '0.7.0'
5
+ s.version = '0.7.1'
6
6
  s.authors = ['stanhu']
7
7
  s.email = ['stanhu@gmail.com']
8
8
  s.homepage = 'https://gitlab.com/gitlab-org/fluent-plugins/fluent-plugin-postgresql-csvlog'
@@ -7,7 +7,7 @@ module Fluent::Plugin
7
7
  # utility method, useful for extracting marginalia into fluentd records
8
8
  module MarginaliaExtractor
9
9
  MARGINALIA_PREPENDED_REGEXP = %r{^(?<comment>/\*.*\*/)(?<sql>.*)}m.freeze
10
- MARGINALIA_APPENDED_REGEXP = %r{(?<sql>.*)(?<comment>/\*.*\*/)$}m.freeze
10
+ MARGINALIA_APPENDED_REGEXP = %r{(?<sql>.*)(?<comment>/\*.*\*/)\s*;?\s*$}m.freeze
11
11
 
12
12
  # Injects marginalia into a fluentd record
13
13
  def parse_marginalia_into_record(record, key, strip_comment)
@@ -56,6 +56,14 @@ class Marginalia < Test::Unit::TestCase
56
56
  test_parse(sql, {}, 'sql', true, expected)
57
57
  end
58
58
 
59
+ test 'normal comment appended with trailing semicolon' do
60
+ sql = 'SELECT COUNT(*) FROM "projects" /* this is just a comment */ ; '
61
+ expected = {
62
+ "sql" => 'SELECT COUNT(*) FROM "projects"'
63
+ }
64
+ test_parse(sql, {}, 'sql', true, expected)
65
+ end
66
+
59
67
  test 'marginalia prepended for sidekiq' do
60
68
  sql = '/*application:sidekiq,correlation_id:d67cae54c169e0cab7d73389e2934f0e,jid:52a1c8a9e4c555ea573f20f0,job_class:Geo::MetricsUpdateWorker*/ SELECT COUNT(*) FROM "projects"'
61
69
  expected = {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-postgresql-csvlog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - stanhu