fluent-plugin-redshift-auto 0.0.5 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +6 -0
- data/VERSION +1 -1
- data/lib/fluent/plugin/out_redshift_auto.rb +7 -3
- metadata +10 -44
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f2123e8ed339b9e6955630349e0f9767080f09b6
|
4
|
+
data.tar.gz: 89c26bead967ca466695f45fa48cd9e8ab3a0b85
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7aeecfcf1a5ee9bafe6d5ce3ccc95e9e508d775ec498a1091ed4a0cd00fb3cb5fc87ee6c7da3f60ffc9f0dad8bf3122de852678620151c0757b15730f9ea6ba0
|
7
|
+
data.tar.gz: 7199a23672044b487dbca3b3fdf37c16a7ec7662344680a894ea2639d5f2bd9c768d37b5fdc304b396e91174a3146bd13930db526c64582f25fe1cb244ceaf78
|
data/README.md
CHANGED
@@ -32,6 +32,8 @@ Format:
|
|
32
32
|
redshift_password YOUR_AMAZON_REDSHIFT_CLUSTER_PASSWORD
|
33
33
|
redshift_schemaname YOUR_AMAZON_REDSHIFT_CLUSTER_TARGET_SCHEMA_NAME
|
34
34
|
redshift_tablename YOUR_AMAZON_REDSHIFT_CLUSTER_TARGET_TABLE_NAME
|
35
|
+
make_auto_table 1 # 1 => make table auto 0 => no
|
36
|
+
tag_table 1 # 1=> tag_name = table_name, 0 => no, use redshift_atablename
|
35
37
|
file_type [tsv|csv|json|msgpack]
|
36
38
|
varchar_length ALL_COLUMNS_VARCHAR_LENGTH
|
37
39
|
|
@@ -115,6 +117,10 @@ Example (watch and upload json formatted apache log):
|
|
115
117
|
|
116
118
|
+ `redshift_schemaname` : schema name to store data. By default, this option is not set and find table without schema as your own search_path.
|
117
119
|
|
120
|
+
+ `make_auto_table` (optional, integer) : whether make tables automatically. If you set 1, this makes tables automatically else if you set 0, doesn't make.
|
121
|
+
|
122
|
+
+ `tag_table` (optional, integer) : whether table_name equals tag_name. If you set 1, it shows tag_name equals table_name, else if you set 0, it's not.
|
123
|
+
|
118
124
|
+ `file_type` : file format of the source data. `csv`, `tsv`, `msgpack` or `json` are available.
|
119
125
|
|
120
126
|
+ `delimiter` : delimiter of the source data. This option will be ignored if `file_type` is specified.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
1.0.1
|
@@ -36,6 +36,7 @@ class RedshiftOutput < BufferedOutput
|
|
36
36
|
config_param :redshift_tablename, :string
|
37
37
|
config_param :redshift_schemaname, :string, :default => "public"
|
38
38
|
config_param :make_auto_table, :integer, :default => 1 #1 => make_auto 0=> no
|
39
|
+
config_param :tag_table, :integer, :default => 1 #1 => tag_name = table_name, 0 => no
|
39
40
|
# file format
|
40
41
|
config_param :file_type, :string, :default => nil # json, tsv, csv
|
41
42
|
config_param :delimiter, :string, :default => nil
|
@@ -90,8 +91,12 @@ class RedshiftOutput < BufferedOutput
|
|
90
91
|
|
91
92
|
def write(chunk)
|
92
93
|
$log.debug format_log("start creating gz.")
|
93
|
-
|
94
|
-
|
94
|
+
if @tag_table == 1 then
|
95
|
+
file_name = File::basename(chunk.path)
|
96
|
+
table_name = file_name.sub(/\..*/, "")
|
97
|
+
else
|
98
|
+
table_name = @redshift_tablename
|
99
|
+
end
|
95
100
|
|
96
101
|
# create a gz file
|
97
102
|
tmp = Tempfile.new("s3-")
|
@@ -113,7 +118,6 @@ class RedshiftOutput < BufferedOutput
|
|
113
118
|
# copy gz on s3 to redshift
|
114
119
|
s3_uri = "s3://#{@s3_bucket}/#{s3path}"
|
115
120
|
sql = @copy_sql_template % [table_name, s3_uri, @aws_sec_key]
|
116
|
-
$log.error format_log(sql)
|
117
121
|
$log.debug format_log("start copying. s3_uri=#{s3_uri}")
|
118
122
|
conn = nil
|
119
123
|
begin
|
metadata
CHANGED
@@ -1,12 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-redshift-auto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
segments:
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 5
|
9
|
-
version: 0.0.5
|
4
|
+
version: 1.0.1
|
10
5
|
platform: ruby
|
11
6
|
authors:
|
12
7
|
- Takashi Honda
|
@@ -14,8 +9,7 @@ autorequire:
|
|
14
9
|
bindir: bin
|
15
10
|
cert_chain: []
|
16
11
|
|
17
|
-
date: 2013-12-
|
18
|
-
default_executable:
|
12
|
+
date: 2013-12-09 00:00:00 Z
|
19
13
|
dependencies:
|
20
14
|
- !ruby/object:Gem::Dependency
|
21
15
|
name: fluentd
|
@@ -24,10 +18,6 @@ dependencies:
|
|
24
18
|
requirements:
|
25
19
|
- - ~>
|
26
20
|
- !ruby/object:Gem::Version
|
27
|
-
segments:
|
28
|
-
- 0
|
29
|
-
- 10
|
30
|
-
- 0
|
31
21
|
version: 0.10.0
|
32
22
|
type: :runtime
|
33
23
|
version_requirements: *id001
|
@@ -38,10 +28,6 @@ dependencies:
|
|
38
28
|
requirements:
|
39
29
|
- - ">="
|
40
30
|
- !ruby/object:Gem::Version
|
41
|
-
segments:
|
42
|
-
- 1
|
43
|
-
- 6
|
44
|
-
- 3
|
45
31
|
version: 1.6.3
|
46
32
|
type: :runtime
|
47
33
|
version_requirements: *id002
|
@@ -52,10 +38,6 @@ dependencies:
|
|
52
38
|
requirements:
|
53
39
|
- - ~>
|
54
40
|
- !ruby/object:Gem::Version
|
55
|
-
segments:
|
56
|
-
- 0
|
57
|
-
- 14
|
58
|
-
- 0
|
59
41
|
version: 0.14.0
|
60
42
|
type: :runtime
|
61
43
|
version_requirements: *id003
|
@@ -64,10 +46,9 @@ dependencies:
|
|
64
46
|
prerelease: false
|
65
47
|
requirement: &id004 !ruby/object:Gem::Requirement
|
66
48
|
requirements:
|
67
|
-
-
|
49
|
+
- &id007
|
50
|
+
- ">="
|
68
51
|
- !ruby/object:Gem::Version
|
69
|
-
segments:
|
70
|
-
- 0
|
71
52
|
version: "0"
|
72
53
|
type: :development
|
73
54
|
version_requirements: *id004
|
@@ -78,10 +59,6 @@ dependencies:
|
|
78
59
|
requirements:
|
79
60
|
- - ">="
|
80
61
|
- !ruby/object:Gem::Version
|
81
|
-
segments:
|
82
|
-
- 0
|
83
|
-
- 5
|
84
|
-
- 4
|
85
62
|
version: 0.5.4
|
86
63
|
type: :development
|
87
64
|
version_requirements: *id005
|
@@ -92,10 +69,6 @@ dependencies:
|
|
92
69
|
requirements:
|
93
70
|
- - ">="
|
94
71
|
- !ruby/object:Gem::Version
|
95
|
-
segments:
|
96
|
-
- 1
|
97
|
-
- 3
|
98
|
-
- 1
|
99
72
|
version: 1.3.1
|
100
73
|
type: :development
|
101
74
|
version_requirements: *id006
|
@@ -118,10 +91,11 @@ files:
|
|
118
91
|
- lib/fluent/plugin/out_redshift_auto.rb
|
119
92
|
- test/plugin/test_out_redshift_auto.rb
|
120
93
|
- test/test_helper.rb
|
121
|
-
has_rdoc: true
|
122
94
|
homepage: https://github.com/takashi-honda/fluent-plugin-redshift-auto
|
123
95
|
licenses: []
|
124
96
|
|
97
|
+
metadata: {}
|
98
|
+
|
125
99
|
post_install_message:
|
126
100
|
rdoc_options: []
|
127
101
|
|
@@ -129,24 +103,16 @@ require_paths:
|
|
129
103
|
- lib
|
130
104
|
required_ruby_version: !ruby/object:Gem::Requirement
|
131
105
|
requirements:
|
132
|
-
-
|
133
|
-
- !ruby/object:Gem::Version
|
134
|
-
segments:
|
135
|
-
- 0
|
136
|
-
version: "0"
|
106
|
+
- *id007
|
137
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
108
|
requirements:
|
139
|
-
-
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
segments:
|
142
|
-
- 0
|
143
|
-
version: "0"
|
109
|
+
- *id007
|
144
110
|
requirements: []
|
145
111
|
|
146
112
|
rubyforge_project:
|
147
|
-
rubygems_version: 1.
|
113
|
+
rubygems_version: 2.1.11
|
148
114
|
signing_key:
|
149
|
-
specification_version:
|
115
|
+
specification_version: 4
|
150
116
|
summary: Amazon Redshift output plugin for Fluentd with creating table
|
151
117
|
test_files:
|
152
118
|
- test/plugin/test_out_redshift_auto.rb
|