Skip to content

Commit

Permalink
Fix configuration for older fluentd versions (#63)
Browse files Browse the repository at this point in the history
* Fix regression for previous fluentds
* lower the logging level for custom_fields/custom_dimensions
* Update changelog due to release fix
  • Loading branch information
sumo-drosiek authored Apr 28, 2020
1 parent dfa2dbd commit 7b25023
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file. Tracking did not begin until version 1.10.

<a name="1.7.1"></a>
# [1.7.1] (2020-04-28)
- Fix configuration for older fluentd versions [#63](https://github.com/SumoLogic/fluentd-output-sumologic/pull/63)

<a name="1.7.0"></a>
# [1.7.0] (2020-04-23)
- Add option for specifing custom fields for logs: [#56](https://github.com/SumoLogic/fluentd-output-sumologic/pull/56)
Expand Down
10 changes: 8 additions & 2 deletions lib/fluent/plugin/out_sumologic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,19 @@ def configure(conf)
end

conf['custom_fields'] = validate_key_value_pairs(conf['custom_fields'])
if conf['custom_fields'].nil?
conf.delete 'custom_fields'
end
unless conf['custom_fields']
@log.info "Custom fields: #{conf['custom_fields']}"
@log.debug "Custom fields: #{conf['custom_fields']}"
end

conf['custom_dimensions'] = validate_key_value_pairs(conf['custom_dimensions'])
if conf['custom_dimensions'].nil?
conf.delete 'custom_dimensions'
end
unless conf['custom_dimensions']
@log.info "Custom dimensions: #{conf['custom_dimensions']}"
@log.debug "Custom dimensions: #{conf['custom_dimensions']}"
end

# For some reason default is set incorrectly in unit-tests
Expand Down

0 comments on commit 7b25023

Please sign in to comment.