anschel 0.7.7 → 0.7.8
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 -1
- data/lib/anschel/output/elasticsearch.rb +6 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46988e35ce9cb55953bccbc212b35388d0c16a2b
|
4
|
+
data.tar.gz: b847da34781e9738a2cb47477459b46ae6b2beb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c99827e1a8875a189f6e0cbedd27fc173ad57930bbc01f525f40884aa340e527eefb2cc514a810a9af244d63a4eebe9ee633d29b6050a1dfd60c815b1064c11
|
7
|
+
data.tar.gz: 812ba77eb7030fc459988a84eef53d190862be83cd62fad8ac7f77b229c5073010ae9896e76dc2ecea311699a41e343e96c4e0b4ab5ebafd65362ace64c6e8f5
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.8
|
data/lib/anschel/filter/index.rb
CHANGED
@@ -18,6 +18,7 @@ module Anschel
|
|
18
18
|
yyyy-MM-dd'T'HH:mm:ssZZ
|
19
19
|
yyyy-MM-dd'T'HH:mm:ssZ
|
20
20
|
] # ISO8601
|
21
|
+
routing = conf.delete(:routing)
|
21
22
|
|
22
23
|
error_tag = conf.has_key?(:error_tag) ? conf[:error_tag] : 'index-error'
|
23
24
|
|
@@ -35,13 +36,15 @@ module Anschel
|
|
35
36
|
stats.create 'filter-index-error'
|
36
37
|
|
37
38
|
log.trace event: 'filter-compiled', kind: 'index', \
|
38
|
-
stamp: stamp, prefix: prefix, suffix: suffix, format: format
|
39
|
+
stamp: stamp, prefix: prefix, suffix: suffix, format: format, routing: routing
|
39
40
|
|
40
41
|
|
41
42
|
|
42
43
|
lambda do |event|
|
43
44
|
idx_prefix = prefix % event
|
44
45
|
|
46
|
+
event[:_routing] = routing % event if routing
|
47
|
+
|
45
48
|
stamped = event.has_key? stamp
|
46
49
|
matched = false
|
47
50
|
|
@@ -38,6 +38,8 @@ module Anschel
|
|
38
38
|
|
39
39
|
body = events.map do |e|
|
40
40
|
index = e.delete(:_index)
|
41
|
+
routing = e.delete(:_routing)
|
42
|
+
|
41
43
|
if index.nil?
|
42
44
|
log.error \
|
43
45
|
event: 'elasticsearch-output-error',
|
@@ -46,7 +48,10 @@ module Anschel
|
|
46
48
|
raw_event: e
|
47
49
|
index = default_index
|
48
50
|
end
|
49
|
-
|
51
|
+
|
52
|
+
item = { _index: index, _type: e[:type], data: e }
|
53
|
+
item[:_routing] = routing if routing
|
54
|
+
{ index: item }
|
50
55
|
end
|
51
56
|
|
52
57
|
client.bulk body: body
|