anschel 0.7.13 → 0.7.14

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3242d0a83b7366bcc669dd0cdd72da530d80146
4
- data.tar.gz: 9935e614a1a16533ac38e6117e41b925a613c6e7
3
+ metadata.gz: 1f0c3d10796c001fc16c23ccb3edc30d51e5788d
4
+ data.tar.gz: 32ce3c011cf4af31a47532b1e67436cec033fb33
5
5
  SHA512:
6
- metadata.gz: aabe51a20bcd7c005cd0623b6b818b5abe1e24d9bf0e7c27edb618d99bcee80f5786e880e82a865c3af179bf5ce6dfc755d1778049c6c6fd5caa9027d4124f5f
7
- data.tar.gz: e2c7dca19901daa4759953f629de75bf5ad6ac8877bbf5e4faba12ceeec39d73debdfc8c07bbedf910b90eced25ce2551f544c7577cf46dfca3d34295426c935
6
+ metadata.gz: a8e9694e66e623c5f1dfeb982119bcf69444b27887486a676e82e2c9c607774ff2d40d9a972e15382615a00215315360a7cfb52206caaec1752a007a7c0a84bd
7
+ data.tar.gz: 29b0e4269ba2722b3f0edb67890f30aa25a31d84a462976dada2181c86f3aa184acf4ab7ba57a0079fbc8b7bdcc4cc91c0a367d999d2c26300862c3323884825
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.13
1
+ 0.7.14
data/lib/anschel/main.rb CHANGED
@@ -77,8 +77,20 @@ module Anschel
77
77
  ts += num_cpus.times.map do
78
78
  Thread.new do
79
79
  loop do
80
- event = JrJackson::Json.load \
81
- input.shift, symbolize_keys: true
80
+ raw = input.shift.encode 'UTF-8', \
81
+ invalid: :replace, undef: :replace, replace: '?'
82
+
83
+ begin
84
+ event = JrJackson::Json.load raw, symbolize_keys: true
85
+ rescue JrJackson::ParseError
86
+ log.error \
87
+ event: 'main-input-error',
88
+ reason: 'could not parse event',
89
+ remediation: 'skipping',
90
+ raw_event: raw
91
+ next
92
+ end
93
+
82
94
  output.push filter.apply(event)
83
95
  stats.inc 'event'
84
96
  end
@@ -29,6 +29,7 @@ module Anschel
29
29
  until (Time.now.to_f - start > timeout) || ((count += 1) > bsize)
30
30
  begin
31
31
  events.push @queue.shift(true)
32
+ count += 1
32
33
  rescue # shift returned immediately
33
34
  sleep slice
34
35
  end
@@ -54,7 +55,16 @@ module Anschel
54
55
  { index: item }
55
56
  end
56
57
 
57
- client.bulk body: body
58
+ response = client.bulk body: body
59
+
60
+ if response['errors']
61
+ log.error \
62
+ event: 'elasticsearch-output-error',
63
+ reason: 'response contained errors',
64
+ body: body,
65
+ response: response
66
+ end
67
+
58
68
  stats.inc 'output', body.size
59
69
  end
60
70
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anschel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.13
4
+ version: 0.7.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Clemmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-08 00:00:00.000000000 Z
11
+ date: 2016-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement