anschel 0.7.13 → 0.7.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/anschel/main.rb +14 -2
- data/lib/anschel/output/elasticsearch.rb +11 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f0c3d10796c001fc16c23ccb3edc30d51e5788d
|
4
|
+
data.tar.gz: 32ce3c011cf4af31a47532b1e67436cec033fb33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8e9694e66e623c5f1dfeb982119bcf69444b27887486a676e82e2c9c607774ff2d40d9a972e15382615a00215315360a7cfb52206caaec1752a007a7c0a84bd
|
7
|
+
data.tar.gz: 29b0e4269ba2722b3f0edb67890f30aa25a31d84a462976dada2181c86f3aa184acf4ab7ba57a0079fbc8b7bdcc4cc91c0a367d999d2c26300862c3323884825
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
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
|
-
|
81
|
-
|
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.
|
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-
|
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
|