anschel 0.7.15 → 0.7.16
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/filter/index.rb +4 -4
- data/lib/anschel/output/elasticsearch.rb +6 -4
- 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: b5611f7bad8a6808996d244caf2482fef45e2641
|
4
|
+
data.tar.gz: a6420bda8d746c71fe5aa30b7b5bc24f9a9f11a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27a2fdfdb9a6f9aaca45b76a0248437fe378a71a9611bbf6330d7238b7994225c37cc15d1e303361fe4394fdbaec9242c8db32dce04e546993ee7a013f2c04e2
|
7
|
+
data.tar.gz: 400c0258c448fa8d04c96b510d45d101f6d5ccbcc0ae8d27efa9ad4fc601a84a2ad1dd5012ee3fe6a8a7e4b8a5076e5bd928cab0668b71706fadeec970b83f63
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.16
|
data/lib/anschel/filter/index.rb
CHANGED
@@ -43,7 +43,7 @@ module Anschel
|
|
43
43
|
lambda do |event|
|
44
44
|
idx_prefix = prefix % event
|
45
45
|
|
46
|
-
event[
|
46
|
+
event[:@routing] = routing % event if routing
|
47
47
|
|
48
48
|
stamped = event.has_key? stamp
|
49
49
|
matched = false
|
@@ -52,7 +52,7 @@ module Anschel
|
|
52
52
|
begin
|
53
53
|
millis = j.parseMillis event[stamp]
|
54
54
|
idx_suffix = Time.at(0.001 * millis).utc.strftime(suffix)
|
55
|
-
event[
|
55
|
+
event[:@index] = idx_prefix + idx_suffix
|
56
56
|
stats.inc 'filter-index'
|
57
57
|
matched = true
|
58
58
|
rescue java.lang.IllegalArgumentException => e
|
@@ -64,13 +64,13 @@ module Anschel
|
|
64
64
|
|
65
65
|
timestamp = Time.now.utc
|
66
66
|
event[stamp] = timestamp.iso8601(3) unless stamped
|
67
|
-
event[
|
67
|
+
event[:@index] = idx_prefix + timestamp.strftime(suffix)
|
68
68
|
|
69
69
|
log.warn \
|
70
70
|
event: 'filter-index-warning',
|
71
71
|
reason: 'could not parse event',
|
72
72
|
remediation: 'added bogus index',
|
73
|
-
remediation: "sending to best-guess index '#{event[
|
73
|
+
remediation: "sending to best-guess index '#{event[:@index]}'",
|
74
74
|
stamp: stamp,
|
75
75
|
prefix: prefix,
|
76
76
|
suffix: suffix,
|
@@ -38,8 +38,9 @@ module Anschel
|
|
38
38
|
next if events.empty?
|
39
39
|
|
40
40
|
body = events.map do |e|
|
41
|
-
|
42
|
-
|
41
|
+
id = e.delete(:@id)
|
42
|
+
index = e.delete(:@index)
|
43
|
+
routing = e.delete(:@routing)
|
43
44
|
|
44
45
|
if index.nil?
|
45
46
|
log.error \
|
@@ -52,6 +53,7 @@ module Anschel
|
|
52
53
|
|
53
54
|
item = { _index: index, _type: e[:type], data: e }
|
54
55
|
item[:_routing] = routing if routing
|
56
|
+
item[:_id] = id if id
|
55
57
|
{ index: item }
|
56
58
|
end
|
57
59
|
|
@@ -61,8 +63,8 @@ module Anschel
|
|
61
63
|
log.error \
|
62
64
|
event: 'elasticsearch-output-error',
|
63
65
|
reason: 'response contained errors',
|
64
|
-
|
65
|
-
|
66
|
+
body_size: body.size,
|
67
|
+
response_size: response['items'].size
|
66
68
|
end
|
67
69
|
|
68
70
|
stats.inc 'output', body.size
|
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.16
|
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-02-
|
11
|
+
date: 2016-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|