fluent-plugin-syslog 0.1.13 → 0.1.18

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
- SHA1:
3
- metadata.gz: c38ea160729671a98a08a7f13a36c585e13a2ac3
4
- data.tar.gz: 75b488296324f1304863ad24ae0c95fd8187e70b
2
+ SHA256:
3
+ metadata.gz: b06c656eeafbdc84939b354ea13beb4e1c40e47e269594e2a40d5b2fb4352873
4
+ data.tar.gz: 7b66543fdaa72ec0446b0b2959f54ddc31df0ff326ad9f582d8d9a7bf1ddab5a
5
5
  SHA512:
6
- metadata.gz: 72d8d15a52729b552851fd78929de8472b1ff4150c202877af7b68e52b9c51c8327fb62a32fecb651a34a460426ab889c98b872101a934577015aabc047d18fd
7
- data.tar.gz: 229db1f39b75f817223636ce3679109c85e52d3cbd2fc25941aa9716bf48680b4ea3af2be8aba1329cfd389c8b1d70bda255a8ed1d340df3109d61137dd4f623
6
+ metadata.gz: dec31328a2feb3851ce8ed024dd980d947d95880ce4e64064cbd7e5f9b905734e625d2939aa7fd069de8f4ba6d17d495220c9d02cde3b27e583e466092fb53c2
7
+ data.tar.gz: 85ce188dfe5343da19869926efd45dae0435dc4762e3af9ff5dd08fd71fadffbb5310f3a87ee657e943c0436a65a691388da7a8c5fdb7d18b27505112c2ad6da
data/README.md CHANGED
@@ -18,7 +18,7 @@ gem install fluent-plugin-syslog
18
18
 
19
19
  This is a buffered output plugin for Fluentd that's configured to send logs to Syslog.
20
20
 
21
- Each log line will arrive in Loggly with 2 payloads: the json representation of the fluent record and the data from the syslog wrapper.
21
+ Each log line will arrive in Syslog with 2 payloads: the json representation of the fluent record and the data from the syslog wrapper.
22
22
 
23
23
  Data from the syslog wrapper includes:
24
24
  ```
@@ -45,11 +45,12 @@ Also, if you set `parse_json` to true, as is shown in the example above, then th
45
45
  ### Advanced Configuration
46
46
  This plugin inherits a few useful config parameters from Fluent's `BufferedOutput` class.
47
47
 
48
- Parameters for flushing the buffer, based on size and time, are `buffer_chunk_limit` and `flush_interval`, respectively. This plugin overrides the inherited default `flush_interval` to `1`, causing the fluent buffer to flush to Loggly every second.
48
+ Parameters for flushing the buffer, based on size and time, are `buffer_chunk_limit` and `flush_interval`, respectively. This plugin overrides the inherited default `flush_interval` to `1`, causing the fluent buffer to flush to Syslog every second.
49
49
 
50
- If the plugin fails to write to Loggly for any reason, the log message will be put back in Fluent's buffer and retried. Retrying can be tuned and inherits a default configuration where `retry_wait` is set to `1` second and `retry_limit` is set to `17` attempts.
50
+ If the plugin fails to write to Syslog for any reason, the log message will be put back in Fluent's buffer and retried. Retrying can be tuned and inherits a default configuration where `retry_wait` is set to `1` second and `retry_limit` is set to `17` attempts.
51
51
 
52
52
  If you want to change any of these parameters simply add them to the match stanza. For example, to flush the buffer every 60 seconds and stop retrying after 2 attempts, set something like:
53
+
53
54
  ```xml
54
55
  <match whatever.*>
55
56
  @type syslog
@@ -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-syslog"
7
- spec.version = "0.1.13"
7
+ spec.version = "0.1.18"
8
8
  spec.authors = ["Aaron Collins"]
9
9
  spec.email = ["aaron.collins@hiremya.com"]
10
10
 
@@ -11,7 +11,7 @@ module Fluent
11
11
  # if syslog_token left empty in fluent config, it will throw Fluent::ConfigError
12
12
  config_param :syslog_token, :string
13
13
  config_param :syslog_tag, :string, default: nil
14
- config_param :syslog_hostname, :string, default: nil
14
+ config_param :syslog_hostname, :string, default: ENV['HOSTNAME']
15
15
  config_param :syslog_app, :string, default: nil
16
16
  config_param :syslog_host, :string, default: 'localhost'
17
17
  config_param :syslog_port, :integer, default: 6514
@@ -87,12 +87,20 @@ module Fluent
87
87
  end
88
88
  end
89
89
 
90
+ if record.dig('levelname')
91
+ begin
92
+ record['level'] = record['levelname']
93
+ record.delete('levelname')
94
+ end
95
+ end
96
+
90
97
  if @parse_json
91
98
  begin
92
99
  parser = Yajl::Parser.new
93
100
  parsed_message = parser.parse(record['message'])
94
- record.merge(parsed_message)
95
- log.warn "Parsing JSON Log #{parsed_message}"
101
+ if parsed_message.is_a?(Hash)
102
+ record = record.merge(parsed_message)
103
+ end
96
104
  rescue Yajl::ParseError
97
105
  end
98
106
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-syslog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Collins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-07 00:00:00.000000000 Z
11
+ date: 2020-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -136,8 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  - !ruby/object:Gem::Version
137
137
  version: '0'
138
138
  requirements: []
139
- rubyforge_project:
140
- rubygems_version: 2.5.2.3
139
+ rubygems_version: 3.0.3
141
140
  signing_key:
142
141
  specification_version: 4
143
142
  summary: Fluentd output plugin