fluent-plugin-loggly-syslog 0.0.2 → 0.0.3.pre.a
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/LICENSE +1 -1
- data/README.md +2 -0
- data/fluent-plugin-loggly-syslog.gemspec +3 -3
- data/lib/fluent/plugin/out_loggly_syslog.rb +9 -0
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5286f76bf09cf06da3316d4e3fe0d8db84721c05
|
4
|
+
data.tar.gz: 87e55d865084ee05e39ee370ba164692758e751f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa0c6b16c01ce5fc5d63e7dbbbfbeea864c954bd8d648d4acbc720c82038cd3f57ccaac02d6d3cba2ff1bf67428214e27f8de152a30dae4e01de10d01dff130a
|
7
|
+
data.tar.gz: 917daaaf11527b31ebed72d7e9884a6a23679fa3fdee302b56ac52fbbbbc3d75775309e1c56a14510469c8de310d78d9f18e1f3b2948cc83d68113d3e1f488c0
|
data/LICENSE
CHANGED
@@ -186,7 +186,7 @@
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
187
187
|
identification within third-party archives.
|
188
188
|
|
189
|
-
Copyright
|
189
|
+
Copyright 2018 SolarWinds Worldwide, LLC
|
190
190
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
192
192
|
you may not use this file except in compliance with the License.
|
data/README.md
CHANGED
@@ -37,9 +37,11 @@ To configure this in fluentd:
|
|
37
37
|
loggly_token <your_loggly_token>
|
38
38
|
loggly_tag <your_loggly_tag>
|
39
39
|
loggly_hostname "#{ENV['HOST']}"
|
40
|
+
parse_json true
|
40
41
|
</match>
|
41
42
|
```
|
42
43
|
|
44
|
+
Also, if you set `parse_json` to true, as is shown in the example above, then the plugin will attempt to parse the `message` field from each fluentd record.
|
43
45
|
|
44
46
|
### Advanced Configuration
|
45
47
|
This plugin inherits a few useful config parameters from Fluent's `BufferedOutput` class.
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "fluent-plugin-loggly-syslog"
|
7
|
-
spec.version = "0.0.
|
7
|
+
spec.version = "0.0.3-a"
|
8
8
|
spec.authors = ["Chris Rust"]
|
9
9
|
spec.email = ["chris.rust@solarwinds.com"]
|
10
10
|
|
@@ -20,9 +20,9 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
-
spec.add_dependency "fluentd", '>=
|
23
|
+
spec.add_dependency "fluentd", '>= 1.2', '< 2'
|
24
24
|
|
25
|
-
spec.add_development_dependency "bundler", "~> 1
|
25
|
+
spec.add_development_dependency "bundler", "~> 2.0.1"
|
26
26
|
spec.add_development_dependency "rake", "~> 10.0"
|
27
27
|
spec.add_development_dependency "minitest", "~> 5.0"
|
28
28
|
spec.add_development_dependency "test-unit", "~> 3.2"
|
@@ -13,6 +13,7 @@ module Fluent
|
|
13
13
|
config_param :loggly_host, :string, default: 'logs-01.loggly.com'
|
14
14
|
config_param :loggly_port, :integer, default: 6514
|
15
15
|
config_param :discard_unannotated_pod_logs, :bool, default: false
|
16
|
+
config_param :parse_json, :bool, default: false
|
16
17
|
# overriding default flush_interval (60 sec) from Fluent::BufferedOutput
|
17
18
|
config_param :flush_interval, :time, default: 1
|
18
19
|
|
@@ -94,6 +95,14 @@ module Fluent
|
|
94
95
|
# [xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx@41058 tag="syslog"] \
|
95
96
|
# message'
|
96
97
|
|
98
|
+
if @parse_json && record.dig('message')
|
99
|
+
begin
|
100
|
+
parsed_message = JSON.parse(record.message)
|
101
|
+
record.message = parsed_message
|
102
|
+
rescue JSON::ParserError
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
97
106
|
pri = 134 # 134 is hardcoded facility local0 and severity info
|
98
107
|
version = 1 # Syslog Protocol v1
|
99
108
|
record_time = time ? Time.at(time) : Time.now
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-loggly-syslog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3.pre.a
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Rust
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.2'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '2'
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '1.2'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '2'
|
@@ -36,14 +36,14 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
39
|
+
version: 2.0.1
|
40
40
|
type: :development
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
46
|
+
version: 2.0.1
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rake
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -117,12 +117,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
117
117
|
version: '0'
|
118
118
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
119
|
requirements:
|
120
|
-
- - "
|
120
|
+
- - ">"
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version:
|
122
|
+
version: 1.3.1
|
123
123
|
requirements: []
|
124
124
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.
|
125
|
+
rubygems_version: 2.6.14.3
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: Syslog output Fluentd plugin for Loggly
|