logstash-output-gelf 3.1.2 → 3.1.3
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 +4 -4
- data/Gemfile +8 -1
- data/docs/index.asciidoc +167 -0
- data/lib/logstash/outputs/gelf.rb +4 -1
- data/logstash-output-gelf.gemspec +3 -3
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0598ec9e712d1a04f7087c216512ae0c7b39340
|
4
|
+
data.tar.gz: c8365db3baf6a855670c31b900e59ef2b783becb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15e8401b4e95cae106aab5c340efcc4aded296200dc6d80bc5ce05dc5f6661288aca73fd67841aba30291d4e6338acb86d4071caed4f16ad30ba4bcff8b6b051
|
7
|
+
data.tar.gz: 0672299319ea17210aa18db5134a1bfe15991ca28bf450f9e263dcf897e613a3dabe2a33a8031884a8d328212b4a98d530402479159212e88e914c390925e2f7
|
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
|
data/docs/index.asciidoc
ADDED
@@ -0,0 +1,167 @@
|
|
1
|
+
:plugin: gelf
|
2
|
+
:type: output
|
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
|
+
=== Gelf output plugin
|
18
|
+
|
19
|
+
include::{include_path}/plugin_header.asciidoc[]
|
20
|
+
|
21
|
+
==== Description
|
22
|
+
|
23
|
+
This output generates messages in GELF format. This is most useful if you
|
24
|
+
want to use Logstash to output events to Graylog2.
|
25
|
+
|
26
|
+
More information at http://graylog2.org/gelf#specs[The Graylog2 GELF specs page]
|
27
|
+
|
28
|
+
[id="plugins-{type}s-{plugin}-options"]
|
29
|
+
==== Gelf Output Configuration Options
|
30
|
+
|
31
|
+
This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
|
32
|
+
|
33
|
+
[cols="<,<,<",options="header",]
|
34
|
+
|=======================================================================
|
35
|
+
|Setting |Input type|Required
|
36
|
+
| <<plugins-{type}s-{plugin}-chunksize>> |<<number,number>>|No
|
37
|
+
| <<plugins-{type}s-{plugin}-custom_fields>> |<<hash,hash>>|No
|
38
|
+
| <<plugins-{type}s-{plugin}-full_message>> |<<string,string>>|No
|
39
|
+
| <<plugins-{type}s-{plugin}-host>> |<<string,string>>|Yes
|
40
|
+
| <<plugins-{type}s-{plugin}-ignore_metadata>> |<<array,array>>|No
|
41
|
+
| <<plugins-{type}s-{plugin}-level>> |<<array,array>>|No
|
42
|
+
| <<plugins-{type}s-{plugin}-port>> |<<number,number>>|No
|
43
|
+
| <<plugins-{type}s-{plugin}-sender>> |<<string,string>>|No
|
44
|
+
| <<plugins-{type}s-{plugin}-ship_metadata>> |<<boolean,boolean>>|No
|
45
|
+
| <<plugins-{type}s-{plugin}-ship_tags>> |<<boolean,boolean>>|No
|
46
|
+
| <<plugins-{type}s-{plugin}-short_message>> |<<string,string>>|No
|
47
|
+
|=======================================================================
|
48
|
+
|
49
|
+
Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
|
50
|
+
output plugins.
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
[id="plugins-{type}s-{plugin}-chunksize"]
|
55
|
+
===== `chunksize`
|
56
|
+
|
57
|
+
* Value type is <<number,number>>
|
58
|
+
* Default value is `1420`
|
59
|
+
|
60
|
+
The GELF chunksize. You usually don't need to change this.
|
61
|
+
|
62
|
+
[id="plugins-{type}s-{plugin}-custom_fields"]
|
63
|
+
===== `custom_fields`
|
64
|
+
|
65
|
+
* Value type is <<hash,hash>>
|
66
|
+
* Default value is `{}`
|
67
|
+
|
68
|
+
The GELF custom field mappings. GELF supports arbitrary attributes as custom
|
69
|
+
fields. This exposes that. Exclude the `_` portion of the field name
|
70
|
+
e.g. `custom_fields => ['foo_field', 'some_value']`
|
71
|
+
sets `_foo_field` = `some_value`.
|
72
|
+
|
73
|
+
[id="plugins-{type}s-{plugin}-full_message"]
|
74
|
+
===== `full_message`
|
75
|
+
|
76
|
+
* Value type is <<string,string>>
|
77
|
+
* Default value is `"%{message}"`
|
78
|
+
|
79
|
+
The GELF full message. Dynamic values like `%{foo}` are permitted here.
|
80
|
+
|
81
|
+
[id="plugins-{type}s-{plugin}-host"]
|
82
|
+
===== `host`
|
83
|
+
|
84
|
+
* This is a required setting.
|
85
|
+
* Value type is <<string,string>>
|
86
|
+
* There is no default value for this setting.
|
87
|
+
|
88
|
+
Graylog2 server IP address or hostname.
|
89
|
+
|
90
|
+
[id="plugins-{type}s-{plugin}-ignore_metadata"]
|
91
|
+
===== `ignore_metadata`
|
92
|
+
|
93
|
+
* Value type is <<array,array>>
|
94
|
+
* Default value is `["@timestamp", "@version", "severity", "host", "source_host", "source_path", "short_message"]`
|
95
|
+
|
96
|
+
Ignore these fields when `ship_metadata` is set. Typically this lists the
|
97
|
+
fields used in dynamic values for GELF fields.
|
98
|
+
|
99
|
+
[id="plugins-{type}s-{plugin}-level"]
|
100
|
+
===== `level`
|
101
|
+
|
102
|
+
* Value type is <<array,array>>
|
103
|
+
* Default value is `["%{severity}", "INFO"]`
|
104
|
+
|
105
|
+
The GELF message level. Dynamic values like `%{level}` are permitted here;
|
106
|
+
useful if you want to parse the 'log level' from an event and use that
|
107
|
+
as the GELF level/severity.
|
108
|
+
|
109
|
+
Values here can be integers [0..7] inclusive or any of
|
110
|
+
"debug", "info", "warn", "error", "fatal" (case insensitive).
|
111
|
+
Single-character versions of these are also valid, "d", "i", "w", "e", "f",
|
112
|
+
"u"
|
113
|
+
The following additional severity\_labels from Logstash's syslog\_pri filter
|
114
|
+
are accepted: "emergency", "alert", "critical", "warning", "notice", and
|
115
|
+
"informational".
|
116
|
+
|
117
|
+
[id="plugins-{type}s-{plugin}-port"]
|
118
|
+
===== `port`
|
119
|
+
|
120
|
+
* Value type is <<number,number>>
|
121
|
+
* Default value is `12201`
|
122
|
+
|
123
|
+
Graylog2 server port number.
|
124
|
+
|
125
|
+
[id="plugins-{type}s-{plugin}-sender"]
|
126
|
+
===== `sender`
|
127
|
+
|
128
|
+
* Value type is <<string,string>>
|
129
|
+
* Default value is `"%{host}"`
|
130
|
+
|
131
|
+
Allow overriding of the GELF `sender` field. This is useful if you
|
132
|
+
want to use something other than the event's source host as the
|
133
|
+
"sender" of an event. A common case for this is using the application name
|
134
|
+
instead of the hostname.
|
135
|
+
|
136
|
+
[id="plugins-{type}s-{plugin}-ship_metadata"]
|
137
|
+
===== `ship_metadata`
|
138
|
+
|
139
|
+
* Value type is <<boolean,boolean>>
|
140
|
+
* Default value is `true`
|
141
|
+
|
142
|
+
Should Logstash ship metadata within event object? This will cause Logstash
|
143
|
+
to ship any fields in the event (such as those created by grok) in the GELF
|
144
|
+
messages. These will be sent as underscored "additional fields".
|
145
|
+
|
146
|
+
[id="plugins-{type}s-{plugin}-ship_tags"]
|
147
|
+
===== `ship_tags`
|
148
|
+
|
149
|
+
* Value type is <<boolean,boolean>>
|
150
|
+
* Default value is `true`
|
151
|
+
|
152
|
+
Ship tags within events. This will cause Logstash to ship the tags of an
|
153
|
+
event as the field `\_tags`.
|
154
|
+
|
155
|
+
[id="plugins-{type}s-{plugin}-short_message"]
|
156
|
+
===== `short_message`
|
157
|
+
|
158
|
+
* Value type is <<string,string>>
|
159
|
+
* Default value is `"short_message"`
|
160
|
+
|
161
|
+
The GELF short message field name. If the field does not exist or is empty,
|
162
|
+
the event message is taken instead.
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
[id="plugins-{type}s-{plugin}-common-options"]
|
167
|
+
include::{include_path}/{type}.asciidoc[]
|
@@ -19,6 +19,9 @@ class LogStash::Outputs::Gelf < LogStash::Outputs::Base
|
|
19
19
|
# The GELF chunksize. You usually don't need to change this.
|
20
20
|
config :chunksize, :validate => :number, :default => 1420
|
21
21
|
|
22
|
+
# The transport protocol, either TCP or UDP.
|
23
|
+
config :protocol, :validate => ["TCP", "UDP"], :default => "UDP"
|
24
|
+
|
22
25
|
# Allow overriding of the GELF `sender` field. This is useful if you
|
23
26
|
# want to use something other than the event's source host as the
|
24
27
|
# "sender" of an event. A common case for this is using the application name
|
@@ -80,7 +83,7 @@ class LogStash::Outputs::Gelf < LogStash::Outputs::Base
|
|
80
83
|
option_hash = Hash.new
|
81
84
|
|
82
85
|
#@gelf = GELF::Notifier.new(@host, @port, @chunksize, option_hash)
|
83
|
-
@gelf ||= GELF::Notifier.new(@host, @port, @chunksize)
|
86
|
+
@gelf ||= GELF::Notifier.new(@host, @port, @chunksize, { :protocol => GELF::Protocol.const_get(@protocol) })
|
84
87
|
|
85
88
|
# This sets the 'log level' of gelf; since we're forwarding messages, we'll
|
86
89
|
# want to forward *all* messages, so set level to 0 so all messages get
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-output-gelf'
|
4
|
-
s.version = '3.1.
|
4
|
+
s.version = '3.1.3'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "This output generates messages in GELF format."
|
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[
|
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)/})
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
# Gem dependencies
|
23
23
|
s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
|
24
24
|
|
25
|
-
s.add_runtime_dependency 'gelf', ['
|
25
|
+
s.add_runtime_dependency 'gelf', ['3.0.0']
|
26
26
|
s.add_runtime_dependency 'logstash-codec-plain'
|
27
27
|
|
28
28
|
s.add_development_dependency 'logstash-devutils'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-gelf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
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
|
@@ -35,7 +35,7 @@ dependencies:
|
|
35
35
|
requirements:
|
36
36
|
- - '='
|
37
37
|
- !ruby/object:Gem::Version
|
38
|
-
version:
|
38
|
+
version: 3.0.0
|
39
39
|
name: gelf
|
40
40
|
prerelease: false
|
41
41
|
type: :runtime
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
requirements:
|
44
44
|
- - '='
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
46
|
+
version: 3.0.0
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
49
49
|
requirements:
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- LICENSE
|
85
85
|
- NOTICE.TXT
|
86
86
|
- README.md
|
87
|
+
- docs/index.asciidoc
|
87
88
|
- lib/logstash/outputs/gelf.rb
|
88
89
|
- logstash-output-gelf.gemspec
|
89
90
|
- spec/outputs/gelf_spec.rb
|