logstash-output-elasticsearch_groom 0.1.0 → 0.1.1

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: 486c325f8f953643e6326d2108b6751ad1097adb
4
- data.tar.gz: 5fa13b6edbcde045d49bd4c8f5e11a353a02e172
3
+ metadata.gz: 572182b0e882b6216332343092806f1444dca57e
4
+ data.tar.gz: 6a8d23c1889ca80591e56205a28a431b565ecf72
5
5
  SHA512:
6
- metadata.gz: d1ebb214123441133ecdf04bb0fc2d9063b474543e7a49eafd67bdf69019563ba18e8500505acad887db63b085aae05ca9db590611e090d79b148ba4c43f5513
7
- data.tar.gz: 9c4cd555da338cff715d26c7db2d504f14fd0b191d3b038ec996fc68d2fe5489b248362c29a2c42a1ce41059d1d16976c073096912bf1cff6df8a0d87baa0019
6
+ metadata.gz: 10adaacb5004ff852d175b2c1a71deea3c17b6cfe81b2e4a5a54b2cfcba26cec52b718d68059da44322b29606bba0824af903cf1b6f2d9ba0fad24520d07caaa
7
+ data.tar.gz: 05208d886fedeb73454205b7d8cd7ab67073d96204c5ae7398048588b98ce9f1b6a441ca1692c7569a6ffbbd27503c4f4d07a463784672010a0514266fc57d0e
data/.gitignore CHANGED
@@ -7,4 +7,5 @@ lib/logstash-output-elasticsearch_groom_jars.rb
7
7
  lib/com
8
8
  lib/org
9
9
  /.idea
10
- /*.iml
10
+ /*.iml
11
+ /out
data/example.conf CHANGED
@@ -31,8 +31,4 @@ output {
31
31
  action => '%{action}'
32
32
  }
33
33
  }
34
-
35
- stdout {
36
- codec => rubydebug
37
- }
38
34
  }
@@ -93,7 +93,7 @@ class LogStash::Outputs::ElasticsearchGroom < LogStash::Outputs::Base
93
93
  end
94
94
 
95
95
  protected
96
- def self.create_es_accessor(options)
96
+ def create_es_accessor(options)
97
97
  require 'logstash/outputs/elasticsearch_groom/es_accessor'
98
98
 
99
99
  LogStash::Outputs::EsGroom::EsAccessor.new(options)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-elasticsearch_groom'
3
- s.version = "0.1.0"
3
+ s.version = '0.1.1'
4
4
  s.licenses = ["Apache License (2.0)"]
5
5
  s.summary = "Grooms time-series Elastichsearch indices."
6
6
  s.description = "A logstash output plugin that will perform event triggered grooming (aka pruning) of time-series indices especially those created by logstash-output-elasticsearch."
@@ -16,11 +16,30 @@ describe 'outputs/elasticsearch_groom' do
16
16
  output = outputClass.new()
17
17
  output.register
18
18
 
19
- event = LogStash::Event.new(@timestamp => '2015-04-11T00:00:00')
19
+ event = LogStash::Event.new('@timestamp' => '2015-03-15T00:00:00')
20
20
 
21
21
  expect(es_accessor).to receive(:matching_indices)
22
22
  .with('logstash-*', 'open')
23
- .and_return(['logstash-2015.04.11'])
23
+ .and_return(['logstash-2015.03.12'])
24
+ expect(es_accessor).not_to receive(:close_indices)
25
+ expect(es_accessor).not_to receive(:delete_indices)
24
26
  output.receive event
25
27
  end
28
+
29
+ it 'should act upon just older ones' do
30
+ output = outputClass.new('action' => 'delete', 'age_cutoff' => '4w')
31
+ output.register
32
+
33
+ event = LogStash::Event.new('@timestamp' => '2015-03-15T00:00:00')
34
+
35
+ expect(es_accessor).to receive(:matching_indices)
36
+ .with('logstash-*', 'open')
37
+ .and_return(%w(logstash-2015.03.12 logstash-2015.02.13 logstash-2015.02.12))
38
+ expect(es_accessor).not_to receive(:close_indices)
39
+ expect(es_accessor).to receive(:delete_indices)
40
+ .with(%w(logstash-2015.02.13 logstash-2015.02.12))
41
+ .once
42
+ output.receive event
43
+
44
+ end
26
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-elasticsearch_groom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoff Bourne