logstash-output-google_bigquery 0.1.5 → 0.1.6

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
  SHA1:
3
- metadata.gz: 613b51c4536d4c8cba38acfb2be32554e12a2022
4
- data.tar.gz: f78269ddde095c489da1b7e2063821225c7cb34b
3
+ metadata.gz: cee99e6ced7e544e287a033d2cc61b8e71187ee9
4
+ data.tar.gz: c3978a76beb30601a47cb445e66b72762c786c07
5
5
  SHA512:
6
- metadata.gz: d1ddca6ed9f5609d16906160e919de3765a76fe2f894c8736bd93cd9ca684f2936755b6ae0eb5767c4c90d90487f375add88daca355594c44658893ec69d6cb6
7
- data.tar.gz: 269c9ac785cf4c4ceab485819cce8af3a1265644d9c0adea3ebeb600d98b5b96a3f7450d6ad90e1f0a4dec59a22fd31ca38a67c8f91b486a8d2362b2076076f8
6
+ metadata.gz: 60b4e21d588075b540959c2fa1a3428e3e14d592336f8c9882469eee52e91838c39213476b6ab93ff6d69ecd502880d022aab8d40165c1f5b57f4ddf6be96ca8
7
+ data.tar.gz: ddb37b6c296ef09e3f120a4d561844f6a5b3a81eafb2574195e1a71d64a1222d6bc75cc3b590055fbe25aaaeb614173960f7cd1daedd7374af2ceb9ada707711
File without changes
@@ -0,0 +1,5 @@
1
+ Elasticsearch
2
+ Copyright 2012-2015 Elasticsearch
3
+
4
+ This product includes software developed by The Apache Software
5
+ Foundation (http://www.apache.org/).
data/README.md CHANGED
@@ -13,7 +13,7 @@ Logstash provides infrastructure to automatically generate documentation for thi
13
13
 
14
14
  ## Need Help?
15
15
 
16
- Need help? Try #logstash on freenode IRC or the logstash-users@googlegroups.com mailing list.
16
+ Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/logstash discussion forum.
17
17
 
18
18
  ## Developing
19
19
 
@@ -17,6 +17,7 @@
17
17
  # limitations under the License.
18
18
  require "logstash/outputs/base"
19
19
  require "logstash/namespace"
20
+ require "logstash/json"
20
21
 
21
22
  # Summary: plugin to upload log events to Google BigQuery (BQ), rolling
22
23
  # files based on the date pattern provided as a configuration setting. Events
@@ -101,6 +102,10 @@ class LogStash::Outputs::GoogleBigQuery < LogStash::Outputs::Base
101
102
  # Example: path:STRING,status:INTEGER,score:FLOAT
102
103
  config :csv_schema, :validate => :string, :required => true
103
104
 
105
+ # Indicates if BigQuery should allow extra values that are not represented in the table schema.
106
+ # If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false.
107
+ config :ignore_unknown_values, :validate => :boolean, :default => false
108
+
104
109
  # Path to private key file for Google Service Account.
105
110
  config :key_path, :validate => :string, :required => true
106
111
 
@@ -467,7 +472,6 @@ class LogStash::Outputs::GoogleBigQuery < LogStash::Outputs::Base
467
472
  # Uploads a local file to the configured bucket.
468
473
  def get_job_status(job_id)
469
474
  begin
470
- require 'json'
471
475
  @logger.debug("BQ: check job status.",
472
476
  :job_id => job_id)
473
477
  get_result = @client.execute(:api_method => @bq.jobs.get,
@@ -475,7 +479,7 @@ class LogStash::Outputs::GoogleBigQuery < LogStash::Outputs::Base
475
479
  'jobId' => job_id,
476
480
  'projectId' => @project_id
477
481
  })
478
- response = JSON.parse(get_result.response.body)
482
+ response = LogStash::Json.load(get_result.response.body)
479
483
  @logger.debug("BQ: successfully invoked API.",
480
484
  :response => response)
481
485
 
@@ -498,7 +502,6 @@ class LogStash::Outputs::GoogleBigQuery < LogStash::Outputs::Base
498
502
  # Uploads a local file to the configured bucket.
499
503
  def upload_object(filename)
500
504
  begin
501
- require 'json'
502
505
  table_id = @table_prefix + "_" + get_date_pattern(filename)
503
506
  # BQ does not accept anything other than alphanumeric and _
504
507
  # Ref: https://developers.google.com/bigquery/browser-tool-quickstart?hl=en
@@ -519,7 +522,8 @@ class LogStash::Outputs::GoogleBigQuery < LogStash::Outputs::Base
519
522
  "tableId" => table_id
520
523
  },
521
524
  'createDisposition' => 'CREATE_IF_NEEDED',
522
- 'writeDisposition' => 'WRITE_APPEND'
525
+ 'writeDisposition' => 'WRITE_APPEND',
526
+ 'ignoreUnknownValues' => @ignore_unknown_values
523
527
  }
524
528
  }
525
529
  }
@@ -531,7 +535,7 @@ class LogStash::Outputs::GoogleBigQuery < LogStash::Outputs::Base
531
535
  },
532
536
  :media => media)
533
537
 
534
- job_id = JSON.parse(insert_result.response.body)["jobReference"]["jobId"]
538
+ job_id = LogStash::Json.load(insert_result.response.body)["jobReference"]["jobId"]
535
539
  @logger.debug("BQ: multipart insert",
536
540
  :job_id => job_id)
537
541
  return job_id
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-output-google_bigquery'
4
- s.version = '0.1.5'
4
+ s.version = '0.1.6'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Plugin to upload log events to Google BigQuery (BQ)"
7
7
  s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
metadata CHANGED
@@ -1,17 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-google_bigquery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-20 00:00:00.000000000 Z
11
+ date: 2015-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- requirement: !ruby/object:Gem::Requirement
14
+ name: logstash-core
15
+ version_requirements: !ruby/object:Gem::Requirement
15
16
  requirements:
16
17
  - - '>='
17
18
  - !ruby/object:Gem::Version
@@ -19,10 +20,7 @@ dependencies:
19
20
  - - <
20
21
  - !ruby/object:Gem::Version
21
22
  version: 2.0.0
22
- name: logstash-core
23
- prerelease: false
24
- type: :runtime
25
- version_requirements: !ruby/object:Gem::Requirement
23
+ requirement: !ruby/object:Gem::Requirement
26
24
  requirements:
27
25
  - - '>='
28
26
  - !ruby/object:Gem::Version
@@ -30,34 +28,36 @@ dependencies:
30
28
  - - <
31
29
  - !ruby/object:Gem::Version
32
30
  version: 2.0.0
31
+ prerelease: false
32
+ type: :runtime
33
33
  - !ruby/object:Gem::Dependency
34
+ name: google-api-client
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
34
40
  requirement: !ruby/object:Gem::Requirement
35
41
  requirements:
36
42
  - - '>='
37
43
  - !ruby/object:Gem::Version
38
44
  version: '0'
39
- name: google-api-client
40
45
  prerelease: false
41
46
  type: :runtime
47
+ - !ruby/object:Gem::Dependency
48
+ name: logstash-devutils
42
49
  version_requirements: !ruby/object:Gem::Requirement
43
50
  requirements:
44
51
  - - '>='
45
52
  - !ruby/object:Gem::Version
46
53
  version: '0'
47
- - !ruby/object:Gem::Dependency
48
54
  requirement: !ruby/object:Gem::Requirement
49
55
  requirements:
50
56
  - - '>='
51
57
  - !ruby/object:Gem::Version
52
58
  version: '0'
53
- name: logstash-devutils
54
59
  prerelease: false
55
60
  type: :development
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - '>='
59
- - !ruby/object:Gem::Version
60
- version: '0'
61
61
  description: This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program
62
62
  email: info@elastic.co
63
63
  executables: []
@@ -65,9 +65,11 @@ extensions: []
65
65
  extra_rdoc_files: []
66
66
  files:
67
67
  - .gitignore
68
+ - CHANGELOG.md
68
69
  - CONTRIBUTORS
69
70
  - Gemfile
70
71
  - LICENSE
72
+ - NOTICE.TXT
71
73
  - README.md
72
74
  - Rakefile
73
75
  - lib/logstash/outputs/google_bigquery.rb