logstash-output-google_bigquery 3.2.3 → 3.2.4

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: f3cfec81c2e6ac9cea32ee0334fbcf55bbef14f77a56be666026979437fff08d
4
- data.tar.gz: 7f93b13e031ef385d7b68bc4875a57c42669ae003da5bad790a5585ed5b0bfd0
3
+ metadata.gz: aa0d62d4409731fe59435066046e0ab5a7696f4becef0f896bb6e86cac701ae9
4
+ data.tar.gz: 4a19742786e58c9a9aa97262f25a5773e155c6b31b33d9e3760025aba45ae87a
5
5
  SHA512:
6
- metadata.gz: 67ab094422b83d711fc78117a38dc46d91e3beee142f47885f9492973da2fb205d9611dc92bdc8c8d9f61fafd6b961eae94ea06633c45f367f508bf60af15919
7
- data.tar.gz: fa5ba368d6f11b897756ac7fde47f3f7ad88cef01fa2f169ecf09cb2f50d2b44b4cc8be0be40c199470d0669ff1e76b601d35a9afa8433a68eaa12200b8ac3e8
6
+ metadata.gz: 6ea1f2b8c954536561fe81aa9b8c1fcfbb06553ac455f00f45fcbc66440027f36ac57ff24bbb769a189d661922d5b9dcd0a4527115563c084e4bf2a26c80cef9
7
+ data.tar.gz: de8befd5d24ba28da45b33f0cbdb395450110eaec708484e49441c768f0231e793f23a63c00febae31b0e1579a5a9ac0a4f92dfa5de7512ddc7988a388a1ef3e
@@ -1,3 +1,6 @@
1
+ ## 3.2.4
2
+ - Docs: Set the default_codec doc attribute.
3
+
1
4
  ## 3.2.3
2
5
  - Update gemspec summary
3
6
 
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012–2016 Elasticsearch <http://www.elastic.co>
1
+ Copyright (c) 2012-2018 Elasticsearch <http://www.elastic.co>
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
@@ -1,5 +1,6 @@
1
1
  :plugin: google_bigquery
2
2
  :type: output
3
+ :default_codec: plain
3
4
 
4
5
  ///////////////////////////////////////////
5
6
  START - GENERATED VARIABLES, DO NOT EDIT!
@@ -299,4 +300,6 @@ around one hour).
299
300
 
300
301
 
301
302
  [id="plugins-{type}s-{plugin}-common-options"]
302
- include::{include_path}/{type}.asciidoc[]
303
+ include::{include_path}/{type}.asciidoc[]
304
+
305
+ :default_codec!:
@@ -129,8 +129,18 @@ class LogStash::Outputs::GoogleBigQuery < LogStash::Outputs::Base
129
129
  # }
130
130
  config :json_schema, :validate => :hash, :required => false, :default => nil
131
131
 
132
- # Indicates if BigQuery should allow extra values that are not represented in the table schema.
133
- # 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.
132
+ # Indicates if BigQuery should ignore values that are not represented in the table schema.
133
+ # If true, the extra values are discarded.
134
+ # If false, BigQuery will reject the records with extra fields and the job will fail.
135
+ # The default value is false.
136
+ #
137
+ # NOTE: You may want to add a Logstash filter like the following to remove common fields it adds:
138
+ # [source,ruby]
139
+ # ----------------------------------
140
+ # mutate {
141
+ # remove_field => ["@version","@timestamp","path","host","type", "message"]
142
+ # }
143
+ # ----------------------------------
134
144
  config :ignore_unknown_values, :validate => :boolean, :default => false
135
145
 
136
146
  # Path to private key file for Google Service Account.
@@ -217,6 +227,9 @@ class LogStash::Outputs::GoogleBigQuery < LogStash::Outputs::Base
217
227
  def receive(event)
218
228
  @logger.debug("BQ: receive method called", :event => event)
219
229
 
230
+ # TODO validate the schema if @ignore_unknown_values is off and alert the user now.
231
+ # consider creating a bad-data table to store invalid records
232
+
220
233
  # Message must be written as json
221
234
  message = LogStash::Json.dump(event.to_hash)
222
235
  # Remove "@" from property names
@@ -360,7 +373,7 @@ class LogStash::Outputs::GoogleBigQuery < LogStash::Outputs::Base
360
373
  when "DONE"
361
374
  if job_status["status"].has_key?("errorResult")
362
375
  @logger.error("BQ: job failed, please enable debug and check full "\
363
- "response (probably the issue is an incompatible "\
376
+ "response (the issue is probably an incompatible "\
364
377
  "schema). NOT deleting local file.",
365
378
  :job_id => job_id,
366
379
  :filename => filename,
@@ -411,9 +424,13 @@ class LogStash::Outputs::GoogleBigQuery < LogStash::Outputs::Base
411
424
  @logger.debug("BQ: reenqueue as log file is being currently appended to.",
412
425
  :filename => filename)
413
426
  @upload_queue << filename
427
+
414
428
  # If we got here, it means that older files were uploaded, so let's
415
- # wait another minute before checking on this file again.
416
- sleep @uploader_interval_secs
429
+ # wait before checking on this file again.
430
+ #
431
+ # Use the min so we don't wait too long if the logs start rotating too quickly
432
+ # due to an increased number of events.
433
+ sleep [60, @uploader_interval_secs].min
417
434
  next
418
435
  else
419
436
  @logger.debug("BQ: flush and close file to be uploaded.",
@@ -435,8 +452,6 @@ class LogStash::Outputs::GoogleBigQuery < LogStash::Outputs::Base
435
452
  :filename => filename)
436
453
  File.delete(filename)
437
454
  end
438
-
439
- sleep @uploader_interval_secs
440
455
  end
441
456
  end
442
457
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-google_bigquery'
3
- s.version = '3.2.3'
3
+ s.version = '3.2.4'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = "Writes events to Google BigQuery"
6
6
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-google_bigquery
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.3
4
+ version: 3.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-07 00:00:00.000000000 Z
11
+ date: 2018-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement