fluent-plugin-logdna 0.1.5 → 0.1.6

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: 14b55b11f2a8e65f520848e562af9c9b35c5fcc7
4
- data.tar.gz: 2d37a86e2329cfd1b24850f362cd90b9c30f07d0
3
+ metadata.gz: '0398268bf9892c432c3967e42597f632f7ee7649'
4
+ data.tar.gz: 8af44955e3a216ee649e5f24a4f0f9704895fe73
5
5
  SHA512:
6
- metadata.gz: 4af3c7d17e7aef3a6b62f1ca890bb32ebf6f6ce9a768aa2bc6dc6169d2d8ae0a057aab8a0592cb9470a38cc9b0755c4d58ed751c9dd17bcf21f334547209a382
7
- data.tar.gz: c37bc197d3799956743d4596f1c8b37ea7a13f10c4053c9ffd62a54a6366115aa9c149e949a46f6ab19079b2ccb4e1a555e402eff813ea00b7c495234dfbadcc
6
+ metadata.gz: 417514d84e3013f733980cfb9246a0b24b185edc7a01a90fad0f6a7ed2ad5b4ac2ac23aacb26e8481ba896072a3cfdebd07c9f48b01c108d1a6204b5f52552d6
7
+ data.tar.gz: fc8bb95df974512ce1e1dc46bdeda3a0b3e78f26cc20467858ead062784591fa3ef28c0022bd17cccbad8acce20b4c800d1480a7ff3d17ed419b805b71b0931e
data/README.md CHANGED
@@ -8,21 +8,52 @@ Using fluent-plugin-logdna, you can send the logs you collect with Fluentd to Lo
8
8
 
9
9
  * Install [Fluentd](http://www.fluentd.org/download)
10
10
  * `gem install fluent-plugin-logdna` or `td-agent-gem install fluent-plugin-logdna` if you are using td-agent.
11
- * Make sure you have a LogDNA account.
12
- * Configure Fluentd like the following:
11
+ * Add the contents below to `/etc/fluent/fluent.conf`. For td-agent, use `/etc/td-agent/td-agent.conf`:
13
12
 
14
13
  ~~~~~
15
14
  <match your_match>
16
15
  @type logdna
17
- api_key xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # paste your api key here (required)
18
- hostname my_host # replace with your hostname (required)
19
- mac C0:FF:EE:C0:FF:EE # replace with host mac address
20
- ip 127.0.0.1 # replace with host ip address
21
- app my_app # replace with your app name
16
+ api_key xxxxxxxxxxxxxxxxxxxxxxxxxxx # paste your api key here (required)
17
+ hostname "#{Socket.gethostname}" # your hostname (required)
18
+ app my_app # replace with your app name
19
+ #mac C0:FF:EE:C0:FF:EE # optional mac address
20
+ #ip 127.0.0.1 # optional ip address
21
+ buffer_chunk_limit 1m # do not increase past 10m (10MB) or your logs will be rejected by our server.
22
+ flush_at_shutdown true # only needed with file buffer
22
23
  </match>
23
24
  ~~~~~
24
25
  * Restart fluentd to pick up the configuration changes.
25
26
 
26
- For advanced configuration options, refer to the [buffered output parameters documentation.](http://docs.fluentd.org/articles/output-plugin-overview#buffered-output-parameters)
27
+ ### Recommended Configuration Parameters
28
+
29
+ * buffer_type
30
+ - We recommend setting this to memory for development and file for production (file setting requires a buffer_path).
31
+ * buffer_queue_limit, buffer_chunk_limit
32
+ - We do not recommend increasing buffer_chunk_limit past 10MB.
33
+ * flush_interval
34
+ - Default is 60s. We recommend keeping this well above 5s.
35
+ * retry_wait, max_retry_wait, retry_limit, disable_retry_limit
36
+ - We recommend increasing these values if you are encountering problems.
37
+
38
+ ### Options
39
+
40
+ * App name and log level can also be provided on a line-by-line basis over JSON:
41
+ * `_app` and `level` will override the config
42
+
43
+ If you don't have a LogDNA account, you can create one on https://logdna.com or if you're on macOS w/[Homebrew](https://brew.sh) installed:
44
+
45
+ ```
46
+ brew cask install logdna-cli
47
+ logdna register <email>
48
+ # now paste the api key above
49
+ ```
50
+
51
+ ### LogDNA Pay-per-gig Pricing
52
+
53
+ Our [paid plans](https://logdna.com/#pricing) start at $1.25/GB per month, pay for what you use / no fixed data buckets / all paid plans include all features.
54
+
55
+ ## Additional Options
56
+
57
+ For advanced configuration options, please refer to the [buffered output parameters documentation.](http://docs.fluentd.org/articles/output-plugin-overview#buffered-output-parameters)
27
58
 
28
59
  Questions or concerns? Contact [support@logdna.com](mailto:support@logdna.com).
@@ -3,7 +3,7 @@ require 'date'
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'fluent-plugin-logdna'
6
- s.version = '0.1.5'
6
+ s.version = '0.1.6'
7
7
  s.date = Date.today.to_s
8
8
  s.summary = 'LogDNA plugin for Fluentd'
9
9
  s.description = 'Fluentd plugin for supplying output to LogDNA.'
@@ -5,6 +5,7 @@ module Fluent
5
5
  Fluent::Plugin.register_output('logdna', self)
6
6
 
7
7
  INGESTER_DOMAIN = 'https://logs.logdna.com'.freeze
8
+ MAX_RETRIES = 5
8
9
 
9
10
  config_param :api_key, :string, secret: true
10
11
  config_param :hostname, :string
@@ -22,7 +23,9 @@ module Fluent
22
23
  require 'json'
23
24
  require 'base64'
24
25
  require 'http'
26
+ HTTP.default_options = { :keep_alive_timeout => 60 }
25
27
  @ingester = HTTP.persistent INGESTER_DOMAIN
28
+ @requests = Queue.new
26
29
  end
27
30
 
28
31
  def shutdown
@@ -37,7 +40,8 @@ module Fluent
37
40
  def write(chunk)
38
41
  body = chunk_to_body(chunk)
39
42
  response = send_request(body)
40
- handle(response)
43
+ raise 'Encountered server error' if response.code >= 400
44
+ response.flush
41
45
  end
42
46
 
43
47
  private
@@ -65,17 +69,6 @@ module Fluent
65
69
  line
66
70
  end
67
71
 
68
- def handle(response)
69
- if response.code >= 400
70
- print "Error connecting to LogDNA ingester. \n"
71
- print "Details: #{response}"
72
- else
73
- print "Success! #{response}"
74
- end
75
-
76
- response.flush
77
- end
78
-
79
72
  def send_request(body)
80
73
  now = Time.now.to_i
81
74
  url = "/logs/ingest?hostname=#{@host}&mac=#{@mac}&ip=#{@ip}&now=#{now}"
metadata CHANGED
@@ -1,53 +1,53 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-logdna
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edwin Lai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-16 00:00:00.000000000 Z
11
+ date: 2017-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.12.0
20
- - - <
20
+ - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '2'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: 0.12.0
30
- - - <
30
+ - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '2'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: http
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ~>
37
+ - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: '2.0'
40
- - - '>='
40
+ - - ">="
41
41
  - !ruby/object:Gem::Version
42
42
  version: 2.0.3
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ~>
47
+ - - "~>"
48
48
  - !ruby/object:Gem::Version
49
49
  version: '2.0'
50
- - - '>='
50
+ - - ">="
51
51
  - !ruby/object:Gem::Version
52
52
  version: 2.0.3
53
53
  description: Fluentd plugin for supplying output to LogDNA.
@@ -56,8 +56,8 @@ executables: []
56
56
  extensions: []
57
57
  extra_rdoc_files: []
58
58
  files:
59
- - .gitignore
60
- - .ruby-version
59
+ - ".gitignore"
60
+ - ".ruby-version"
61
61
  - LICENSE
62
62
  - README.md
63
63
  - fluent-plugin-logdna.gemspec
@@ -72,17 +72,17 @@ require_paths:
72
72
  - lib
73
73
  required_ruby_version: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - '>='
75
+ - - ">="
76
76
  - !ruby/object:Gem::Version
77
77
  version: 2.0.0
78
78
  required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  requirements: []
84
84
  rubyforge_project:
85
- rubygems_version: 2.0.14.1
85
+ rubygems_version: 2.6.8
86
86
  signing_key:
87
87
  specification_version: 4
88
88
  summary: LogDNA plugin for Fluentd