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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fd63aaf4685f342a67b1ae1393d6f0ab7c4fab2d76b0e1b8f65a20d544c7fbf
|
4
|
+
data.tar.gz: faca443f2ff5b0bba6baa960918619e21ba03d86055cbb6a38d27278e56d903c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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>/\*.*\*/)
|
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 = {
|