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 +4 -4
- data/.gitignore +2 -1
- data/example.conf +0 -4
- data/lib/logstash/outputs/elasticsearch_groom.rb +1 -1
- data/logstash-output-elasticsearch_groom.gemspec +1 -1
- data/spec/outputs/elasticsearch_groom_spec.rb +21 -2
- 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: 572182b0e882b6216332343092806f1444dca57e
|
4
|
+
data.tar.gz: 6a8d23c1889ca80591e56205a28a431b565ecf72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10adaacb5004ff852d175b2c1a71deea3c17b6cfe81b2e4a5a54b2cfcba26cec52b718d68059da44322b29606bba0824af903cf1b6f2d9ba0fad24520d07caaa
|
7
|
+
data.tar.gz: 05208d886fedeb73454205b7d8cd7ab67073d96204c5ae7398048588b98ce9f1b6a441ca1692c7569a6ffbbd27503c4f4d07a463784672010a0514266fc57d0e
|
data/.gitignore
CHANGED
data/example.conf
CHANGED
@@ -93,7 +93,7 @@ class LogStash::Outputs::ElasticsearchGroom < LogStash::Outputs::Base
|
|
93
93
|
end
|
94
94
|
|
95
95
|
protected
|
96
|
-
def
|
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
|
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-
|
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.
|
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
|