fluent-plugin-sumologic_output 0.0.4 → 0.0.6

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: 97eada7f4ea132cde6d0ac4faefa45120a09aa52
4
- data.tar.gz: 5ee2d4ed95c994b49f36f4dbca967397826da1db
3
+ metadata.gz: 0b2260d6a95c18397cc58bb448924c2a24f3c28c
4
+ data.tar.gz: 1276401aa4df5460ee70dfb4424202874800e997
5
5
  SHA512:
6
- metadata.gz: 7312d317c0affb314875663e43fc4103e0fc83eaaa0a522a0d84cbef9849eadb7c810e6dac0464644d45571fdbaf919f1252d7de6d4db3e23d3ee8579e6f19a8
7
- data.tar.gz: d729412b8f6114cec33e1e90db22927ff28a1ee78a71e6fb78223b4f28a52875ba85fbeef14b3ab5a34fa332c978d86e4b493514b69a4c52dea4a3f2010b78b4
6
+ metadata.gz: '09326bd5f95564b91f9d124ce397c292d2069734e3e75bd0d2b73de4cb09389ee903dbbbbad177d299d527d6c8c68dc723fd5d69727f7eaa92ffef223b610b07'
7
+ data.tar.gz: 80c274b634f568abe34b5eaaeb9521b6407181af7244229fd2c0f5bd28eb58e7ed1435348c67603fcf21dce6d773758d0508da4402ad4d24733d44a19221f058
data/.gitignore CHANGED
@@ -1,5 +1,4 @@
1
1
  *.gem
2
2
  *.rbc
3
3
  Gemfile.lock
4
- .idea/
5
- fluent
4
+ .idea/
data/README.md CHANGED
@@ -13,7 +13,8 @@ Configuration options for fluent.conf are:
13
13
  * `endpoint` - SumoLogic HTTP Collector URL
14
14
  * `verify_ssl` - Verify ssl certificate. (default is `true`)
15
15
  * `source_category` - Set _sourceCategory metadata field within SumoLogic (default is `nil`)
16
- * `source_name` - Set _sourceName metadata field within SumoLogic (default is `nil`)
16
+ * `source_name` - Set _sourceName metadata field within SumoLogic - overrides source_name_key (default is `nil`)
17
+ * `source_name_key` - Set as source::path_key's value so that the source_name can be extracted from Fluentd's buffer (default `source_name`)
17
18
  * `source_host` - Set _sourceHost metadata field within SumoLogic (default is `nil`)
18
19
  * `log_format` - Format to post logs into Sumo. (default `json`)
19
20
  * text - Logs will appear in SumoLogic in text format (taken from the field specified in `log_key`)
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "fluent-plugin-sumologic_output"
7
- gem.version = "0.0.4"
7
+ gem.version = "0.0.6"
8
8
  gem.authors = ["Steven Adams"]
9
9
  gem.email = ["stevezau@gmail.com"]
10
10
  gem.description = %q{Output plugin to SumoLogic HTTP Endpoint}
@@ -44,6 +44,7 @@ class Sumologic < Fluent::BufferedOutput
44
44
  config_param :log_key, :string, :default => 'message'
45
45
  config_param :source_category, :string, :default => nil
46
46
  config_param :source_name, :string, :default => nil
47
+ config_param :source_name_key, :string, :default => 'source_name'
47
48
  config_param :source_host, :string, :default => nil
48
49
  config_param :verify_ssl, :bool, :default => true
49
50
 
@@ -115,7 +116,10 @@ class Sumologic < Fluent::BufferedOutput
115
116
 
116
117
  # Sort messages
117
118
  chunk.msgpack_each do |tag, time, record|
118
- sumo_metadata = record.fetch('_sumo_metadata', {})
119
+ # plugin dies randomly
120
+ # https://github.com/uken/fluent-plugin-elasticsearch/commit/8597b5d1faf34dd1f1523bfec45852d380b26601#diff-ae62a005780cc730c558e3e4f47cc544R94
121
+ next unless record.is_a? Hash
122
+ sumo_metadata = record.fetch('_sumo_metadata', {'source' => record[@source_name_key]})
119
123
  key = sumo_key(sumo_metadata)
120
124
  log_format = sumo_metadata['log_format'] || @log_format
121
125
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-sumologic_output
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Adams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-05 00:00:00.000000000 Z
11
+ date: 2017-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  version: '0'
85
85
  requirements: []
86
86
  rubyforge_project:
87
- rubygems_version: 2.6.11
87
+ rubygems_version: 2.6.12
88
88
  signing_key:
89
89
  specification_version: 4
90
90
  summary: Output plugin to SumoLogic HTTP Endpoint