fluent-plugin-out-http 1.1.2 → 1.1.3
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/CHANGELOG.md +3 -0
- data/ISSUE_TEMPLATE.md +21 -0
- data/fluent-plugin-out-http.gemspec +1 -1
- data/lib/fluent/plugin/out_http.rb +1 -1
- data/test/plugin/test_out_http.rb +27 -0
- metadata +3 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: c1070709b043ea9772ddf71b806a2f7807775e7e8ebc19d1ba0408df37926f9e
         | 
| 4 | 
            +
              data.tar.gz: d904c7394b6ae84450ad67f8aa0ea8dacfdc27f73d9e4bedb3b3f4d12bf58ccd
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: a5b7fab8ecd5bfa6b49e75aabf6c01b25d78a4f356c8275cdce5a8df996c688a3e648b040795a3487f5d9f7a0e9defc6c89ab49478d1c6216c05106a6b0dc152
         | 
| 7 | 
            +
              data.tar.gz: 472f6517e9e46aff558e255256cc27851673bd50cfe015195b34419f4a5e0a77e96318208103992b96ea65e55dd8cb91ccd4c3d8728d1806acdd9abcd97f1efa
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/ISSUE_TEMPLATE.md
    ADDED
    
    | @@ -0,0 +1,21 @@ | |
| 1 | 
            +
            #### Problem
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            ...
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            #### Steps to replicate
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            Provide example config and message
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            #### Expected Behavior or What you need to ask
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            ...
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            #### Using Fluentd and out_http plugin versions
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            * OS version
         | 
| 16 | 
            +
            * Fluentd v0.12 or v0.14/v1.0
         | 
| 17 | 
            +
              * paste result of ``fluentd --version`` or ``td-agent --version``
         | 
| 18 | 
            +
            * out_http plugin 1.x.y or 0.x.y
         | 
| 19 | 
            +
              * paste boot log of fluentd or td-agent
         | 
| 20 | 
            +
              * paste result of ``fluent-gem list``, ``td-agent-gem list`` or your Gemfile.lock
         | 
| 21 | 
            +
            * Bear Metal or Within Docker or Kubernetes or others? (optional)
         | 
| @@ -2,7 +2,7 @@ | |
| 2 2 |  | 
| 3 3 | 
             
            Gem::Specification.new do |gem|
         | 
| 4 4 | 
             
              gem.name          = "fluent-plugin-out-http"
         | 
| 5 | 
            -
              gem.version       = "1.1. | 
| 5 | 
            +
              gem.version       = "1.1.3"
         | 
| 6 6 | 
             
              gem.authors       = ["Marica Odagaki"]
         | 
| 7 7 | 
             
              gem.email         = ["ento.entotto@gmail.com"]
         | 
| 8 8 | 
             
              gem.summary       = %q{A generic Fluentd output plugin to send logs to an HTTP endpoint}
         | 
| @@ -114,7 +114,7 @@ class Fluent::Plugin::HTTPOutput < Fluent::Plugin::Output | |
| 114 114 | 
             
              def create_request(tag, time, record)
         | 
| 115 115 | 
             
                url = format_url(tag, time, record)
         | 
| 116 116 | 
             
                uri = URI.parse(url)
         | 
| 117 | 
            -
                req = Net::HTTP.const_get(@http_method.to_s.capitalize).new(uri. | 
| 117 | 
            +
                req = Net::HTTP.const_get(@http_method.to_s.capitalize).new(uri.request_uri)
         | 
| 118 118 | 
             
                set_body(req, tag, time, record)
         | 
| 119 119 | 
             
                set_header(req, tag, time, record)
         | 
| 120 120 | 
             
                return req, uri
         | 
| @@ -204,6 +204,10 @@ class HTTPOutputTest < HTTPOutputTestBase | |
| 204 204 | 
             
                endpoint_url http://127.0.0.1:#{port}/api/
         | 
| 205 205 | 
             
              ]
         | 
| 206 206 |  | 
| 207 | 
            +
              CONFIG_QUERY_PARAM = %[
         | 
| 208 | 
            +
                endpoint_url http://127.0.0.1:#{port}/api?foo=bar&baz=qux
         | 
| 209 | 
            +
              ]
         | 
| 210 | 
            +
             | 
| 207 211 | 
             
              CONFIG_JSON = %[
         | 
| 208 212 | 
             
                endpoint_url http://127.0.0.1:#{port}/api/
         | 
| 209 213 | 
             
                serializer json
         | 
| @@ -284,6 +288,29 @@ class HTTPOutputTest < HTTPOutputTestBase | |
| 284 288 | 
             
                assert_equal 2, @posts.size
         | 
| 285 289 | 
             
              end
         | 
| 286 290 |  | 
| 291 | 
            +
              def test_emit_form_with_query_params
         | 
| 292 | 
            +
                d = create_driver CONFIG_QUERY_PARAM
         | 
| 293 | 
            +
                d.run(default_tag: 'test.metrics') do
         | 
| 294 | 
            +
                  d.feed({ 'field1' => 50, 'field2' => 20, 'field3' => 10, 'otherfield' => 1, 'binary' => "\xe3\x81\x82".force_encoding("ascii-8bit") })
         | 
| 295 | 
            +
                end
         | 
| 296 | 
            +
             | 
| 297 | 
            +
                assert_equal 1, @posts.size
         | 
| 298 | 
            +
                record = @posts[0]
         | 
| 299 | 
            +
             | 
| 300 | 
            +
                assert_equal '50', record[:form]['field1']
         | 
| 301 | 
            +
                assert_equal '20', record[:form]['field2']
         | 
| 302 | 
            +
                assert_equal '10', record[:form]['field3']
         | 
| 303 | 
            +
                assert_equal '1', record[:form]['otherfield']
         | 
| 304 | 
            +
                assert_equal URI.encode_www_form_component("あ").upcase, record[:form]['binary'].upcase
         | 
| 305 | 
            +
                assert_nil record[:auth]
         | 
| 306 | 
            +
             | 
| 307 | 
            +
                d.run(default_tag: 'test.metrics') do
         | 
| 308 | 
            +
                  d.feed({ 'field1' => 50, 'field2' => 20, 'field3' => 10, 'otherfield' => 1 })
         | 
| 309 | 
            +
                end
         | 
| 310 | 
            +
             | 
| 311 | 
            +
                assert_equal 2, @posts.size
         | 
| 312 | 
            +
              end
         | 
| 313 | 
            +
             | 
| 287 314 | 
             
              def test_emit_form_with_custom_headers
         | 
| 288 315 | 
             
                d = create_driver CONFIG + %[custom_headers {"key":"custom","token":"arbitrary"}]
         | 
| 289 316 | 
             
                d.run(default_tag: 'test.metrics') do
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: fluent-plugin-out-http
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.1. | 
| 4 | 
            +
              version: 1.1.3
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Marica Odagaki
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2018- | 
| 11 | 
            +
            date: 2018-12-05 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: yajl-ruby
         | 
| @@ -97,6 +97,7 @@ files: | |
| 97 97 | 
             
            - ".travis.yml"
         | 
| 98 98 | 
             
            - CHANGELOG.md
         | 
| 99 99 | 
             
            - Gemfile
         | 
| 100 | 
            +
            - ISSUE_TEMPLATE.md
         | 
| 100 101 | 
             
            - LICENSE.txt
         | 
| 101 102 | 
             
            - README.md
         | 
| 102 103 | 
             
            - Rakefile
         |