fluent-plugin-logentries 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c973411ae7e9499402db5d96d7f1152e96373fd2
4
- data.tar.gz: 25d4bdbc59d939572120322c6dde47a504ec4b35
3
+ metadata.gz: c1fc17a79f9e065c5a8a9f6864b9297c1baf7765
4
+ data.tar.gz: bef9079fbd310d72a44d277bfe0084c9021e0504
5
5
  SHA512:
6
- metadata.gz: ae9d78c6a6222efa59e56edaf9fe85e23aa9fca42d3876e50cf18b3fe0146eb1ff9b3dc8a341c207a7bdb9999f2b9cdb05419a914d2f83437aac29e621e42c4a
7
- data.tar.gz: 5f12446124f2226232c8f70817b82648bd9be962d5f676c995d48a1a19a48b3cb5ceedc1cb76e4f5d8000ad6e8e581a74e09a7c2996e3518009c505ede0bbb4a
6
+ metadata.gz: b8c205c48bc660ed68551c2b93becea9ef3e3768b01d64aae23708ef5145970ae250e610c704e2a41e718399319c88afb105101518f411c5d981624e2ebf5b07
7
+ data.tar.gz: f3039171065808e2d41bbcb2bc7c691161dc16bb1da32f6203e25eb9f6a6e13ba9ecac485a2671502a043db79e8677144430c50d926235f5c61252d38f839df0
data/README.md CHANGED
@@ -25,7 +25,7 @@ install with gem or fluent-gem command as:
25
25
  access: 5deab21c-04b1-9122-abdc-09adb2eda22 (*)
26
26
  error: 9acfbeba-c92c-1229-ccac-12c58d82ecc (*)
27
27
  ```
28
- (*) `access` and `error` are optional, if you don't use multiple log per host just provide an app token.
28
+ (*) `access` and `error are optional, if you don't use multiple log per host just provide an app token.
29
29
 
30
30
  This file is read everytime the buffer is flushed, it allows on fly modifications.
31
31
  ## Usage
@@ -45,11 +45,14 @@ The value must be `logentries`.
45
45
  ### config_path (required)
46
46
  Path of your configuration file, e.g. `/opt/logentries/tokens.conf`
47
47
 
48
+ ### protocol
49
+ The default is `tcp`.
50
+
48
51
  ### use_ssl
49
52
  Enable/disable SSL for data transfers between Fluentd and Logentries. The default is `true`.
50
53
 
51
- ### no_ssl_port
52
- Only in case you don't use SSL, the value must be `80`, `514`, or `10000`. The default is `80`
54
+ ### port
55
+ Only in case you don't use SSL, the value must be `80`, `514`, or `10000`. The default is `20000` (SSL)
53
56
 
54
57
  ### max_retries
55
58
  Number of retries on failure.
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "fluent-plugin-logentries"
7
- spec.version = "0.2.2"
7
+ spec.version = "0.2.3"
8
8
  spec.authors = ["Woorank"]
9
9
  spec.email = ["dev@woorank.com"]
10
10
  spec.summary = "Logentries output plugin for Fluent event collector"
@@ -9,15 +9,18 @@ class LogentriesOutput < Fluent::BufferedOutput
9
9
  Fluent::Plugin.register_output('logentries', self)
10
10
 
11
11
  config_param :use_ssl, :bool, :default => true
12
- config_param :no_ssl_port, :integer, :default => 80
12
+ config_param :port, :integer, :default => 20000
13
+ config_param :protocol, :string, :default => 'tcp'
13
14
  config_param :config_path, :string
14
15
  config_param :max_retries, :integer, :default => 3
15
16
  config_param :tag_access_log, :string, :default => 'logs-access'
16
17
  config_param :tag_error_log, :string, :default => 'logs-error'
17
18
 
19
+ SSL_HOST = "api.logentries.com"
20
+ NO_SSL_HOST = "data.logentries.com"
21
+
18
22
  def configure(conf)
19
23
  super
20
-
21
24
  @tokens = nil
22
25
  @last_edit = Time.at(0)
23
26
  end
@@ -30,15 +33,22 @@ class LogentriesOutput < Fluent::BufferedOutput
30
33
  super
31
34
  end
32
35
 
33
- def client
36
+ def ssl_client
34
37
  @_socket ||= if @use_ssl
35
38
  context = OpenSSL::SSL::SSLContext.new
36
- socket = TCPSocket.new "api.logentries.com", 20000
39
+ socket = TCPSocket.new SSL_HOST, @port
37
40
  ssl_client = OpenSSL::SSL::SSLSocket.new socket, context
38
41
 
39
42
  ssl_client.connect
40
43
  else
41
- TCPSocket.new "data.logentries.com", @no_ssl_port
44
+ if @protocol == 'tcp'
45
+ TCPSocket.new NO_SSL_HOST, @port
46
+ else
47
+ udp_client = UDPSocket.new
48
+ udp_client.connect NO_SSL_HOST, @port
49
+
50
+ udp_client
51
+ end
42
52
  end
43
53
  end
44
54
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-logentries
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Woorank
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-06 00:00:00.000000000 Z
11
+ date: 2015-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler