logstash-filter-environment 3.0.0 → 3.0.1

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: 4fb95a543d05d09be531ed514dc660132ec645dd
4
- data.tar.gz: a13bef8b92f06451003a72bd50403bc0cf5c3e6d
3
+ metadata.gz: bd5b350100ea0ef093319daf3e7106b5a36eda13
4
+ data.tar.gz: 1c057a2e6b9f1886befa9370340c7b42fe4a7381
5
5
  SHA512:
6
- metadata.gz: aa18f8655cced361fc3a969a0729770e61035b198c871cf4c1b48e08318c031e84e2214e476989687e2eef02b0a80a346d5eac800a68fd58eea9adb487cc0037
7
- data.tar.gz: 2bbcc8826fe2326a381f4ca015086b87a293aad1816530ee066a387d63614558edc7405d0938f1f9cf54d07cb5707017b19713c31b759ce16c4863dbed83a214
6
+ metadata.gz: 4c5ce86876ef75c7225086ce07a30d0153b9eb29b2abdebf9143555451bafcaa033df8b7f72a4ca1a1e4a990ed01bd5f94099c957b2546c5946e9e66b9b0ba59
7
+ data.tar.gz: d68dbadc27bba72d745fb0dab167805d5f2fbcd3e858809967c022c04adaab5cf93c812c0d140bb91113e49d0576483569c496a5f2b86d1b433bfbc62bf2c554
data/Gemfile CHANGED
@@ -1,2 +1,11 @@
1
1
  source 'https://rubygems.org'
2
- gemspec
2
+
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,83 @@
1
+ :plugin: environment
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
+ === Environment filter plugin
18
+
19
+ include::{include_path}/plugin_header.asciidoc[]
20
+
21
+ ==== Description
22
+
23
+ This filter stores environment variables as subfields in the `@metadata` field.
24
+ You can then use these values in other parts of the pipeline.
25
+
26
+ Adding environment variables is as easy as:
27
+ filter {
28
+ environment {
29
+ add_metadata_from_env => { "field_name" => "ENV_VAR_NAME" }
30
+ }
31
+ }
32
+
33
+ Accessing stored environment variables is now done through the `@metadata` field:
34
+
35
+ ["@metadata"]["field_name"]
36
+
37
+ This would reference field `field_name`, which in the above example references
38
+ the `ENV_VAR_NAME` environment variable.
39
+
40
+ IMPORTANT: Previous versions of this plugin put the environment variables as
41
+ fields at the root level of the event. Current versions make use of the
42
+ `@metadata` field, as outlined. You have to change `add_field_from_env` in
43
+ the older versions to `add_metadata_from_env` in the newer version.
44
+
45
+ [id="plugins-{type}s-{plugin}-options"]
46
+ ==== Environment Filter Configuration Options
47
+
48
+ This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
49
+
50
+ [cols="<,<,<",options="header",]
51
+ |=======================================================================
52
+ |Setting |Input type|Required
53
+ | <<plugins-{type}s-{plugin}-add_metadata_from_env>> |<<hash,hash>>|No
54
+ |=======================================================================
55
+
56
+ Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
57
+ filter plugins.
58
+
59
+ &nbsp;
60
+
61
+ [id="plugins-{type}s-{plugin}-add_metadata_from_env"]
62
+ ===== `add_metadata_from_env`
63
+
64
+ * Value type is <<hash,hash>>
65
+ * Default value is `{}`
66
+
67
+ Specify a hash of field names and the environment variable name with the
68
+ value you want imported into Logstash. For example:
69
+
70
+ add_metadata_from_env => { "field_name" => "ENV_VAR_NAME" }
71
+
72
+ or
73
+
74
+ add_metadata_from_env => {
75
+ "field1" => "ENV1"
76
+ "field2" => "ENV2"
77
+ # "field_n" => "ENV_n"
78
+ }
79
+
80
+
81
+
82
+ [id="plugins-{type}s-{plugin}-common-options"]
83
+ include::{include_path}/{type}.asciidoc[]
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-environment'
4
- s.version = '3.0.0'
4
+ s.version = '3.0.1'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Set fields from environment variables"
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-environment
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-17 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
@@ -56,6 +56,7 @@ files:
56
56
  - LICENSE
57
57
  - NOTICE.TXT
58
58
  - README.md
59
+ - docs/index.asciidoc
59
60
  - lib/logstash/filters/environment.rb
60
61
  - logstash-filter-environment.gemspec
61
62
  - spec/filters/environment_spec.rb