fluent-plugin-unomaly 0.1.3 → 0.1.4

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
  SHA256:
3
- metadata.gz: 556f6868f17f51de42a678492f752454abc09823fcc10f6b9814a8b2562b8b4e
4
- data.tar.gz: 04a77b3778eea67e57cb196a24b3c9cf39eea163c4508924b1bcc161dd5d2806
3
+ metadata.gz: d0c3c705ac1b37ab42e34ded472e7a016123ccd9a2efedd223229757dfb22f66
4
+ data.tar.gz: ab149b78ef7b06f3221b0dcad6912c7fc2ad9e3f08a437501cc11c18489742d7
5
5
  SHA512:
6
- metadata.gz: 9ae74c2b8f63a5244245705e74c4c04cd2d68be8856d29eaae615aa92e267e9899c20f2d2d4670bcdead1863221bd4b92aec25fd4efddfeaea3ef62fc9cbbb46
7
- data.tar.gz: 9d0aa64bfb822ad30b4e67ef928f1819576b8b64ad969a84fb479e182f637ff3da1dd128237de3be1968e439e42e2957501296a8f4597d1b2abca9f9d52268f0
6
+ metadata.gz: 9a2d57914ec526b811e02176444149653bdbe1001d1e5aaded859fa02512f9eb71d7f85d00335ce28832cca20731bf21a4d924cc73f364126564c3d8173dbb1d
7
+ data.tar.gz: 113931a6d2afbde7f69dc8c9d17f5ccccc9dd5366904df1deeb97212d3fd623535b83e656c085494892050c422becb1f5a728e6384c538097913b5690ad4b351
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.1.4
2
+
3
+ - Add support for plain HTTP
4
+
1
5
  # 0.1.3
2
6
 
3
7
  - Update lib path from `fluentd` to `fluent`
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'fluent-plugin-unomaly'
3
- spec.version = '0.1.3'
3
+ spec.version = '0.1.4'
4
4
 
5
5
  spec.summary = "Fluentd output plugin for Unomaly"
6
6
  spec.description = "Fluentd output plugin for Unomaly"
@@ -82,8 +82,11 @@ module Fluent
82
82
  metadata.delete(@message_key)
83
83
  metadata["tag"]=tag
84
84
 
85
- unomaly_event["metadata"]=flatten(metadata,"")
85
+ unomaly_event["metadata"]=metadata.to_json
86
86
 
87
+ if @debug
88
+ log.info "Event #{unomaly_event.to_json}"
89
+ end
87
90
  documents.push(unomaly_event)
88
91
  end
89
92
  send_batch(documents)
@@ -92,13 +95,16 @@ module Fluent
92
95
  def send_batch(events)
93
96
  url = @host + @api_path
94
97
  body = events.to_json
98
+ ssl = url.start_with?('https')
95
99
  uri = URI.parse(url)
96
100
  header = {'Content-Type' => 'application/json'}
97
101
 
98
102
  http = Net::HTTP.new(uri.host, uri.port)
99
- http.use_ssl = true
100
- if @accept_self_signed_certs
101
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
103
+ if ssl
104
+ http.use_ssl = true
105
+ if @accept_self_signed_certs
106
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
107
+ end
102
108
  end
103
109
 
104
110
  request = Net::HTTP::Post.new(uri.request_uri, header)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-unomaly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Unomaly