logstash-filter-fingerprint 3.0.3 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b3889ab595d8eca1bc3da12afedeccf70c57370d
4
- data.tar.gz: e6b9ac28e026a168dc2b59ca51cd9df3af7369b6
3
+ metadata.gz: 1a502b11d145b463a450bd1669f6644bf051562c
4
+ data.tar.gz: b9e7aa2c105419346a1679800a90b7b7201ec801
5
5
  SHA512:
6
- metadata.gz: 8ca3a82727adf9af513c611fe06151e22c251043a222bde4bb699e889186bf04631b27780ba75ad83daa9682a615a5d9fed40b543e35e0e82a4481e5c5d8edc1
7
- data.tar.gz: 0a8f6d898e1d2109e968284c7c26c5feadc6bf66d8d61b64d6a25634ae1cd78af01002da0c4001f0edd83bdaec334983490f30edbabe2ea35eafa1f647532d6f
6
+ metadata.gz: 00789a1b6aa331ae025351a340e449790622cef8f2f77679408c1c0855c5f0c6127188fb7d6c715828da2d723ed1a2af02dc1e7dfc2737fb34c1fd165c19ac3b
7
+ data.tar.gz: dd546230448ecb213b3ae5246466614b6f144fd7a1fdd5f93530c295238bc1748a804b859783861556807304737cf6eccd0ebae31a39754429f3dabd62349a2c
data/Gemfile CHANGED
@@ -1,4 +1,11 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in logstash-mass_effect.gemspec
4
3
  gemspec
4
+
5
+ logstash_path = ENV["LOGSTASH_PATH"] || "../../logstash"
6
+ use_logstash_source = ENV["LOGSTASH_SOURCE"] && ENV["LOGSTASH_SOURCE"].to_s == "1"
7
+
8
+ if Dir.exist?(logstash_path) && use_logstash_source
9
+ gem 'logstash-core', :path => "#{logstash_path}/logstash-core"
10
+ gem 'logstash-core-plugin-api', :path => "#{logstash_path}/logstash-core-plugin-api"
11
+ end
@@ -0,0 +1,139 @@
1
+ :plugin: fingerprint
2
+ :type: filter
3
+
4
+ ///////////////////////////////////////////
5
+ START - GENERATED VARIABLES, DO NOT EDIT!
6
+ ///////////////////////////////////////////
7
+ :version: %VERSION%
8
+ :release_date: %RELEASE_DATE%
9
+ :changelog_url: %CHANGELOG_URL%
10
+ :include_path: ../../../../logstash/docs/include
11
+ ///////////////////////////////////////////
12
+ END - GENERATED VARIABLES, DO NOT EDIT!
13
+ ///////////////////////////////////////////
14
+
15
+ [id="plugins-{type}-{plugin}"]
16
+
17
+ === Fingerprint filter plugin
18
+
19
+ include::{include_path}/plugin_header.asciidoc[]
20
+
21
+ ==== Description
22
+
23
+ Create consistent hashes (fingerprints) of one or more fields and store
24
+ the result in a new field.
25
+
26
+ This can e.g. be used to create consistent document ids when inserting
27
+ events into Elasticsearch, allowing events in Logstash to cause existing
28
+ documents to be updated rather than new documents to be created.
29
+
30
+ NOTE: When using any method other than 'UUID', 'PUNCTUATION' or 'MURMUR3'
31
+ you must set the key, otherwise the plugin will raise an exception
32
+
33
+ NOTE: When the `target` option is set to `UUID` the result won't be
34
+ a consistent hash but a random
35
+ https://en.wikipedia.org/wiki/Universally_unique_identifier[UUID].
36
+ To generate UUIDs, prefer the <<plugins-filters-uuid,uuid filter>>.
37
+
38
+ [id="plugins-{type}s-{plugin}-options"]
39
+ ==== Fingerprint Filter Configuration Options
40
+
41
+ This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
42
+
43
+ [cols="<,<,<",options="header",]
44
+ |=======================================================================
45
+ |Setting |Input type|Required
46
+ | <<plugins-{type}s-{plugin}-base64encode>> |<<boolean,boolean>>|No
47
+ | <<plugins-{type}s-{plugin}-concatenate_sources>> |<<boolean,boolean>>|No
48
+ | <<plugins-{type}s-{plugin}-key>> |<<string,string>>|No
49
+ | <<plugins-{type}s-{plugin}-method>> |<<string,string>>, one of `["SHA1", "SHA256", "SHA384", "SHA512", "MD5", "MURMUR3", "IPV4_NETWORK", "UUID", "PUNCTUATION"]`|Yes
50
+ | <<plugins-{type}s-{plugin}-source>> |<<array,array>>|No
51
+ | <<plugins-{type}s-{plugin}-target>> |<<string,string>>|No
52
+ |=======================================================================
53
+
54
+ Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
55
+ filter plugins.
56
+
57
+ &nbsp;
58
+
59
+ [id="plugins-{type}s-{plugin}-base64encode"]
60
+ ===== `base64encode`
61
+
62
+ * Value type is <<boolean,boolean>>
63
+ * Default value is `false`
64
+
65
+ When set to `true`, the `SHA1`, `SHA256`, `SHA384`, `SHA512` and `MD5` fingerprint methods will produce
66
+ base64 encoded rather than hex encoded strings.
67
+
68
+ [id="plugins-{type}s-{plugin}-concatenate_sources"]
69
+ ===== `concatenate_sources`
70
+
71
+ * Value type is <<boolean,boolean>>
72
+ * Default value is `false`
73
+
74
+ When set to `true` and `method` isn't `UUID` or `PUNCTUATION`, the
75
+ plugin concatenates the names and values of all fields given in the
76
+ `source` option into one string (like the old checksum filter) before
77
+ doing the fingerprint computation. If `false` and multiple source
78
+ fields are given, the target field will be an array with fingerprints
79
+ of the source fields given.
80
+
81
+ [id="plugins-{type}s-{plugin}-key"]
82
+ ===== `key`
83
+
84
+ * Value type is <<string,string>>
85
+ * There is no default value for this setting.
86
+
87
+ When used with the `IPV4_NETWORK` method fill in the subnet prefix length.
88
+ Key is required with all methods except `MURMUR3`, `PUNCTUATION` or `UUID`.
89
+ With other methods fill in the HMAC key.
90
+
91
+ [id="plugins-{type}s-{plugin}-method"]
92
+ ===== `method`
93
+
94
+ * This is a required setting.
95
+ * Value can be any of: `SHA1`, `SHA256`, `SHA384`, `SHA512`, `MD5`, `MURMUR3`, `IPV4_NETWORK`, `UUID`, `PUNCTUATION`
96
+ * Default value is `"SHA1"`
97
+
98
+ The fingerprint method to use.
99
+
100
+ If set to `SHA1`, `SHA256`, `SHA384`, `SHA512`, or `MD5` the
101
+ cryptographic keyed-hash function with the same name will be used to
102
+ generate the fingerprint. If set to `MURMUR3` the non-cryptographic
103
+ MurmurHash function will be used.
104
+
105
+ If set to `IPV4_NETWORK` the input data needs to be a IPv4 address and
106
+ the hash value will be the masked-out address using the number of bits
107
+ specified in the `key` option. For example, with "1.2.3.4" as the input
108
+ and `key` set to 16, the hash becomes "1.2.0.0".
109
+
110
+ If set to `PUNCTUATION`, all non-punctuation characters will be removed
111
+ from the input string.
112
+
113
+ If set to `UUID`, a
114
+ https://en.wikipedia.org/wiki/Universally_unique_identifier[UUID] will
115
+ be generated. The result will be random and thus not a consistent hash.
116
+
117
+ [id="plugins-{type}s-{plugin}-source"]
118
+ ===== `source`
119
+
120
+ * Value type is <<array,array>>
121
+ * Default value is `"message"`
122
+
123
+ The name(s) of the source field(s) whose contents will be used
124
+ to create the fingerprint. If an array is given, see the
125
+ `concatenate_sources` option.
126
+
127
+ [id="plugins-{type}s-{plugin}-target"]
128
+ ===== `target`
129
+
130
+ * Value type is <<string,string>>
131
+ * Default value is `"fingerprint"`
132
+
133
+ The name of the field where the generated fingerprint will be stored.
134
+ Any current contents of that field will be overwritten.
135
+
136
+
137
+
138
+ [id="plugins-{type}s-{plugin}-common-options"]
139
+ include::{include_path}/{type}.asciidoc[]
@@ -34,7 +34,7 @@ class LogStash::Filters::Fingerprint < LogStash::Filters::Base
34
34
  config :target, :validate => :string, :default => 'fingerprint'
35
35
 
36
36
  # When used with the `IPV4_NETWORK` method fill in the subnet prefix length.
37
- # Not required for `MURMUR3`, `PUNCTUATION` or `UUID` methods.
37
+ # Key is required with all methods except `MURMUR3`, `PUNCTUATION` or `UUID`.
38
38
  # With other methods fill in the HMAC key.
39
39
  config :key, :validate => :string
40
40
 
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-fingerprint'
4
- s.version = '3.0.3'
4
+ s.version = '3.0.4'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Fingerprint fields using by replacing values with a consistent hash."
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/logstash-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 = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
14
+ s.files = Dir["lib/**/*","spec/**/*","*.gemspec","*.md","CONTRIBUTORS","Gemfile","LICENSE","NOTICE.TXT", "vendor/jar-dependencies/**/*.jar", "vendor/jar-dependencies/**/*.rb", "VERSION", "docs/**/*"]
15
15
 
16
16
  # Tests
17
17
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-fingerprint
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-28 00:00:00.000000000 Z
11
+ date: 2017-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -70,6 +70,7 @@ files:
70
70
  - LICENSE
71
71
  - NOTICE.TXT
72
72
  - README.md
73
+ - docs/index.asciidoc
73
74
  - lib/logstash/filters/fingerprint.rb
74
75
  - logstash-filter-fingerprint.gemspec
75
76
  - spec/filters/fingerprint_spec.rb