logstash-filter-dns 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/logstash-filter-dns.gemspec +3 -3
- metadata +15 -24
- data/.gitignore +0 -4
- data/1795.patch +0 -61
- data/Rakefile +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73cb8fe595b22b20b424bfe6866ba69fd68431a5
|
4
|
+
data.tar.gz: 6c927a38fca97eecf5f82c7123e416dc6e3fd905
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 887d7a1b2b03386141678e8446dfbc03c2e404508049db13f9054435d54e224ec665df9b611bd9734826e13164bbd95c2715637ba71aa9c55b1ca4c9e2ae78a2
|
7
|
+
data.tar.gz: ddc8b7725bfe4d1f296c4cd06dae9e5e79a46b6e81aeefb6d4062ae2a70b89a9be39c955b977c52c23c8d6a1386a1ad68c7a8b263f6188f74e767a4656a3a067
|
data/README.md
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# Logstash Plugin
|
2
2
|
|
3
|
-
This is a plugin for [Logstash](https://github.com/
|
3
|
+
This is a plugin for [Logstash](https://github.com/elastic/logstash).
|
4
4
|
|
5
5
|
It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
|
6
6
|
|
7
7
|
## Documentation
|
8
8
|
|
9
|
-
Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.
|
9
|
+
Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.elastic.co/guide/en/logstash/current/).
|
10
10
|
|
11
11
|
- For formatting code or config example, you can use the asciidoc `[source,ruby]` directive
|
12
|
-
- For more asciidoc formatting tips, see the excellent reference here https://github.com/
|
12
|
+
- For more asciidoc formatting tips, see the excellent reference here https://github.com/elastic/docs#asciidoc-guide
|
13
13
|
|
14
14
|
## Need Help?
|
15
15
|
|
@@ -83,4 +83,4 @@ Programming is not a required skill. Whatever you've seen about open source and
|
|
83
83
|
|
84
84
|
It is more important to the community that you are able to contribute.
|
85
85
|
|
86
|
-
For more information about contributing, see the [CONTRIBUTING](https://github.com/
|
86
|
+
For more information about contributing, see the [CONTRIBUTING](https://github.com/elastic/logstash/blob/master/CONTRIBUTING.md) file.
|
data/logstash-filter-dns.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-filter-dns'
|
4
|
-
s.version = '
|
4
|
+
s.version = '2.0.0'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "This filter will resolve any IP addresses from a field of your choosing."
|
7
7
|
s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.require_paths = ["lib"]
|
12
12
|
|
13
13
|
# Files
|
14
|
-
s.files =
|
14
|
+
s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
|
15
15
|
|
16
16
|
# Tests
|
17
17
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.metadata = { "logstash_plugin" => "true", "logstash_group" => "filter" }
|
21
21
|
|
22
22
|
# Gem dependencies
|
23
|
-
s.add_runtime_dependency "logstash-core",
|
23
|
+
s.add_runtime_dependency "logstash-core", "~> 2.0.0.snapshot"
|
24
24
|
|
25
25
|
s.add_development_dependency 'logstash-devutils'
|
26
26
|
end
|
metadata
CHANGED
@@ -1,64 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-dns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: logstash-core
|
15
|
-
version_requirements: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - '>='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 1.4.0
|
20
|
-
- - <
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 2.0.0
|
23
14
|
requirement: !ruby/object:Gem::Requirement
|
24
15
|
requirements:
|
25
|
-
- -
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: 1.4.0
|
28
|
-
- - <
|
16
|
+
- - ~>
|
29
17
|
- !ruby/object:Gem::Version
|
30
|
-
version: 2.0.0
|
18
|
+
version: 2.0.0.snapshot
|
19
|
+
name: logstash-core
|
31
20
|
prerelease: false
|
32
21
|
type: :runtime
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: logstash-devutils
|
35
22
|
version_requirements: !ruby/object:Gem::Requirement
|
36
23
|
requirements:
|
37
|
-
- -
|
24
|
+
- - ~>
|
38
25
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
26
|
+
version: 2.0.0.snapshot
|
27
|
+
- !ruby/object:Gem::Dependency
|
40
28
|
requirement: !ruby/object:Gem::Requirement
|
41
29
|
requirements:
|
42
30
|
- - '>='
|
43
31
|
- !ruby/object:Gem::Version
|
44
32
|
version: '0'
|
33
|
+
name: logstash-devutils
|
45
34
|
prerelease: false
|
46
35
|
type: :development
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
47
41
|
description: This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program
|
48
42
|
email: info@elastic.co
|
49
43
|
executables: []
|
50
44
|
extensions: []
|
51
45
|
extra_rdoc_files: []
|
52
46
|
files:
|
53
|
-
- .gitignore
|
54
|
-
- 1795.patch
|
55
47
|
- CHANGELOG.md
|
56
48
|
- CONTRIBUTORS
|
57
49
|
- Gemfile
|
58
50
|
- LICENSE
|
59
51
|
- NOTICE.TXT
|
60
52
|
- README.md
|
61
|
-
- Rakefile
|
62
53
|
- lib/logstash/filters/dns.rb
|
63
54
|
- logstash-filter-dns.gemspec
|
64
55
|
- spec/filters/dns_spec.rb
|
@@ -84,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
75
|
version: '0'
|
85
76
|
requirements: []
|
86
77
|
rubyforge_project:
|
87
|
-
rubygems_version: 2.
|
78
|
+
rubygems_version: 2.4.8
|
88
79
|
signing_key:
|
89
80
|
specification_version: 4
|
90
81
|
summary: This filter will resolve any IP addresses from a field of your choosing.
|
data/.gitignore
DELETED
data/1795.patch
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
From 2fae9033755a082b282d9f2e070e0e026154d88a Mon Sep 17 00:00:00 2001
|
2
|
-
From: Joao Duarte <jsvduarte@gmail.com>
|
3
|
-
Date: Sat, 27 Sep 2014 23:59:50 +0200
|
4
|
-
Subject: [PATCH] Fix add_tag behaviour in dns filter
|
5
|
-
|
6
|
-
The filter should only modify the event's fields and tags if and only if
|
7
|
-
all resolves/reverses succeed. So we clone the event, modify the new
|
8
|
-
copy and return it if all operations succeed. Otherwise the original
|
9
|
-
event is not modified.
|
10
|
-
|
11
|
-
For performance reasons we could reverse the clone logic: clone the
|
12
|
-
event, modify the original event and, it case of failure, return the
|
13
|
-
backup.
|
14
|
-
|
15
|
-
Note: this changes the dns filter behaviour towards add_tag
|
16
|
-
---
|
17
|
-
lib/logstash/filters/dns.rb | 12 ++++++---
|
18
|
-
spec/filters/dns_spec.rb | 60 ++++++++++++++++++++++++++++++++++++++++++++-
|
19
|
-
2 files changed, 68 insertions(+), 4 deletions(-)
|
20
|
-
|
21
|
-
diff --git a/lib/logstash/filters/dns.rb b/lib/logstash/filters/dns.rb
|
22
|
-
index 46bb075..f23b819 100644
|
23
|
-
--- a/lib/logstash/filters/dns.rb
|
24
|
-
+++ b/lib/logstash/filters/dns.rb
|
25
|
-
@@ -70,11 +70,14 @@ def register
|
26
|
-
def filter(event)
|
27
|
-
return unless filter?(event)
|
28
|
-
|
29
|
-
+ new_event = event.clone
|
30
|
-
+
|
31
|
-
if @resolve
|
32
|
-
begin
|
33
|
-
status = Timeout::timeout(@timeout) {
|
34
|
-
- resolve(event)
|
35
|
-
+ resolve(new_event)
|
36
|
-
}
|
37
|
-
+ return if status.nil?
|
38
|
-
rescue Timeout::Error
|
39
|
-
@logger.debug("DNS: resolve action timed out")
|
40
|
-
return
|
41
|
-
@@ -84,15 +87,18 @@ def filter(event)
|
42
|
-
if @reverse
|
43
|
-
begin
|
44
|
-
status = Timeout::timeout(@timeout) {
|
45
|
-
- reverse(event)
|
46
|
-
+ reverse(new_event)
|
47
|
-
}
|
48
|
-
+ return if status.nil?
|
49
|
-
rescue Timeout::Error
|
50
|
-
@logger.debug("DNS: reverse action timed out")
|
51
|
-
return
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
- filter_matched(event)
|
56
|
-
+ filter_matched(new_event)
|
57
|
-
+ yield new_event
|
58
|
-
+ event.cancel
|
59
|
-
end
|
60
|
-
|
61
|
-
private
|