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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9b4ba372bd24bf363f2593b92c0e9bbf448f8f3
4
- data.tar.gz: 27ccf9fa0c7431574c197039afcc5511c459ebee
3
+ metadata.gz: 46988e35ce9cb55953bccbc212b35388d0c16a2b
4
+ data.tar.gz: b847da34781e9738a2cb47477459b46ae6b2beb2
5
5
  SHA512:
6
- metadata.gz: 9efd3c6b540d9f030291f426516cd3d14690747796643680b2e5b7eccd1ff9bb64f0be56ad110dcb69f43cc9930e1c905f03ee028b92f14401481c25d8924ba7
7
- data.tar.gz: cb41717bee7f7e53bc6161cef351c124351e969bb17b3022d7658ebf5af277825f9a652902c4548235faa3594e8a451c717cc7b660013d8fc6a19e6011ecd4f4
6
+ metadata.gz: 4c99827e1a8875a189f6e0cbedd27fc173ad57930bbc01f525f40884aa340e527eefb2cc514a810a9af244d63a4eebe9ee633d29b6050a1dfd60c815b1064c11
7
+ data.tar.gz: 812ba77eb7030fc459988a84eef53d190862be83cd62fad8ac7f77b229c5073010ae9896e76dc2ecea311699a41e343e96c4e0b4ab5ebafd65362ace64c6e8f5
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.7
1
+ 0.7.8
@@ -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
- { index: { _index: index, _type: e[:type], data: e } }
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anschel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.7
4
+ version: 0.7.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Clemmer