Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

Commit

Permalink
Merge 338a4f2 into 2d3c255
Browse files Browse the repository at this point in the history
  • Loading branch information
toshitanian committed Oct 10, 2016
2 parents 2d3c255 + 338a4f2 commit 0cf1b2e
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
rvm:
- 1.9.3
- 2.0.0
- 2.1
- 2.2
- ruby-head
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.1.8
* Add verify ssl option
* Restrict ruby version to more than 2.1.0

## 0.1.7
* Specify http status codes with witch this plugin does not raise error


## 0.1.5
* Add headers directive
* Add use_ssl directive
Expand Down
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ A generic [fluentd][1] output plugin for sending logs to an HTTP endpoint
read_timeout 10 # default: 60
raise_on_error false # default: true
raise_on_http_failure true # default: false
ignore_http_status_code 300,400..499 # default: nil # do not raise on these http_hstatus codes
ignore_http_status_code 300,400..499 # default: nil # do not raise on these http_status codes
authentication basic # default: none
username alice # default: ''
password bobpop # default: '', secret: true
use_ssl true # default: false
verify_ssl false # default: true
<headers>
HeaderExample1 header1
HeaderExample2 header2
Expand All @@ -34,6 +35,25 @@ A generic [fluentd][1] output plugin for sending logs to an HTTP endpoint

If you'd like to retry failed requests, consider using [fluent-plugin-bufferize][3].

## how to release

**Include these changes to pull request**

- update `CHANGELOG.md`
- update `README.md`

**After master is updated**

```
# bump `gem.version` in `fluent-plugin-out-http-ext.gemspec`
# upload to rubygems
$ bundle exec rake release
# push updates
$ git push --follow-tags
```

----

Heavily based on [fluent-plugin-growthforecast][2]
Expand Down
2 changes: 2 additions & 0 deletions fluent-plugin-out-http-ext.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Gem::Specification.new do |gem|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"]

gem.required_ruby_version = ">= 2.1.0"

gem.add_runtime_dependency "yajl-ruby", "~> 1.0"
gem.add_runtime_dependency "fluentd", [">= 0.10.0", "< 2"]
gem.add_development_dependency "bundler"
Expand Down
4 changes: 4 additions & 0 deletions lib/fluent/plugin/out_http_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def initialize

config_param :open_timeout, :integer, :default => nil
config_param :read_timeout, :integer, :default => 60
config_param :verify_ssl, :bool, :default => true

# Simple rate limiting: ignore any records within `rate_limit_msec`
# since the last one.
Expand Down Expand Up @@ -208,6 +209,9 @@ def send_request(req, uri)
if @use_ssl
client.use_ssl = true
client.ca_file = OpenSSL::X509::DEFAULT_CERT_FILE
unless @verify_ssl
client.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
end
res = client.start {|http|
http.open_timeout = @open_timeout
Expand Down
2 changes: 1 addition & 1 deletion test/plugin/test_out_http_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def test_emit_form_put
end

def test_emit_json
binary_string = "\xe3\x81\x82".force_encoding("ascii-8bit")
binary_string = "あ"
d = create_driver CONFIG_JSON
d.emit({ 'field1' => 50, 'field2' => 20, 'field3' => 10, 'otherfield' => 1, 'binary' => binary_string })
d.run
Expand Down

0 comments on commit 0cf1b2e

Please sign in to comment.