fluent-plugin-logdna 0.1.5 → 0.1.6
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/README.md +39 -8
- data/fluent-plugin-logdna.gemspec +1 -1
- data/lib/fluent/plugin/out_logdna.rb +5 -12
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0398268bf9892c432c3967e42597f632f7ee7649'
|
4
|
+
data.tar.gz: 8af44955e3a216ee649e5f24a4f0f9704895fe73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
*
|
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
|
18
|
-
hostname
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
-
|
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).
|
@@ -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
|
-
|
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.
|
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-
|
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.
|
85
|
+
rubygems_version: 2.6.8
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: LogDNA plugin for Fluentd
|