fluent-plugin-pghstore 0.2.1 → 0.2.2
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.
- data/README.rdoc +13 -8
- data/fluent-plugin-pghstore.gemspec +1 -1
- data/lib/fluent/plugin/out_pghstore.rb +2 -9
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
=== PgHStoreOutput
|
6
6
|
|
7
|
-
Output to PostgreSQL hstore database.
|
7
|
+
Output to PostgreSQL hstore database.
|
8
8
|
|
9
9
|
Output table should have tag, time and record column.:
|
10
10
|
|
@@ -19,13 +19,13 @@ A tag is splited by "." and stored in the TEXT[]. (Yes, postgres can handle an a
|
|
19
19
|
== Requirement
|
20
20
|
|
21
21
|
- PostgreSQL 9.0 or higher
|
22
|
-
- hstore changed at PostgreSQL 9.0.
|
22
|
+
- hstore changed at PostgreSQL 9.0.
|
23
23
|
- postgres-contrib
|
24
24
|
- ruby-pg
|
25
25
|
|
26
26
|
=== How to Install hstore
|
27
27
|
|
28
|
-
hstore is in the contrib.
|
28
|
+
hstore is in the contrib.
|
29
29
|
|
30
30
|
9.1 or higher:
|
31
31
|
|
@@ -42,25 +42,25 @@ Example:
|
|
42
42
|
<match apache.*>
|
43
43
|
type pghstore
|
44
44
|
database test
|
45
|
-
table test
|
45
|
+
table test
|
46
46
|
table_option CREATE INDEX time_index ON testb (time);
|
47
47
|
</match>
|
48
48
|
|
49
49
|
=== Options
|
50
50
|
|
51
51
|
- Required
|
52
|
-
- database
|
52
|
+
- database
|
53
53
|
- database name
|
54
54
|
- Optional
|
55
55
|
- table
|
56
|
-
- tablename.
|
57
|
-
- If not set, use +fluentd_store+.
|
56
|
+
- tablename.
|
57
|
+
- If not set, use +fluentd_store+.
|
58
58
|
- If not exists, creates automatically.
|
59
59
|
- host
|
60
60
|
- port
|
61
61
|
- user
|
62
62
|
- password
|
63
|
-
- table_option
|
63
|
+
- table_option
|
64
64
|
- Add some SQL. This SQL is called only once when table is created from this plugin.
|
65
65
|
|
66
66
|
== Limitation
|
@@ -82,6 +82,11 @@ License:: Apache License
|
|
82
82
|
|
83
83
|
== ChangeLog
|
84
84
|
|
85
|
+
- 0.2.2 / 2013-04-20
|
86
|
+
|
87
|
+
0.2.1 change caused error in 9.2. 0.2.1 change was not necessary. Thank you kaz29!
|
88
|
+
|
89
|
+
|
85
90
|
- 0.2.1 / 2012-09-11
|
86
91
|
|
87
92
|
PostgreSQL 9.2 {removes hstore's => operator}{http://wiki.postgresql.org/wiki/What's_new_in_PostgreSQL_9.2#Remove_hstore.27s_.3D.3E_operator}. This
|
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "fluent-plugin-pghstore"
|
6
|
-
s.version = "0.2.
|
6
|
+
s.version = "0.2.2"
|
7
7
|
s.authors = ["WAKAYAMA Shirou"]
|
8
8
|
s.email = ["shirou.faw@gmail.com"]
|
9
9
|
s.homepage = "https://github.com/shirou/fluent-plugin-pghstore"
|
@@ -54,11 +54,7 @@ class Fluent::PgHStoreOutput < Fluent::BufferedOutput
|
|
54
54
|
def generate_sql(tag, time, record)
|
55
55
|
kv_list = []
|
56
56
|
record.each {|(key,value)|
|
57
|
-
|
58
|
-
kv_list.push("\"#{key}\" , \"#{value}\"")
|
59
|
-
else
|
60
|
-
kv_list.push("\"#{key}\" => \"#{value}\"")
|
61
|
-
end
|
57
|
+
kv_list.push("\"#{key}\" => \"#{value}\"")
|
62
58
|
}
|
63
59
|
|
64
60
|
tag_list = tag.split(".")
|
@@ -84,14 +80,11 @@ SQL
|
|
84
80
|
else
|
85
81
|
@conn = PG.connect(:dbname => @database, :host => @host, :port => @port)
|
86
82
|
end
|
87
|
-
rescue PGError => e
|
83
|
+
rescue PGError => e
|
88
84
|
$log.error "Error: could not connect database:" + @database
|
89
85
|
return nil
|
90
86
|
end
|
91
87
|
|
92
|
-
@server_version = @conn.server_version
|
93
|
-
@after_9_2 = (@server_version > 90200)
|
94
|
-
|
95
88
|
return @conn
|
96
89
|
|
97
90
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-pghstore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-04-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|