fluent-plugin-heroku-syslog-http 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.circleci/config.yml +35 -0
- data/.gitignore +18 -0
- data/.rubocop.yml +17 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +14 -0
- data/README.md +57 -0
- data/Rakefile +12 -0
- data/fluent-plugin-heroku-syslog.gemspec +21 -0
- data/lib/fluent/plugin/in_heroku_syslog_http.rb +41 -0
- data/lib/fluent/plugin/parser_heroku_syslog_http.rb +71 -0
- data/test/helper.rb +14 -0
- data/test/plugin/test_in_heroku_syslog_http.rb +144 -0
- data/test/plugin/test_parser_heroku_syslog_http.rb +68 -0
- metadata +103 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 232b9309f8c101e5ff0845ef5a8330661d98816d3c25068914a7e2dfbdf5566a
|
4
|
+
data.tar.gz: d5f49511ab61357336c8ef9d99936781709a044994c0af8f0cf0c5e22d537623
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 14d6c03abb519a8f07fbf2ba0e0f894aee8a9b20aa7c3ab2699b6c44317feff51f54b2ce4bd20d0f5e197cdd6090c8994406cb1651bd1e9f8071c731b3197fc2
|
7
|
+
data.tar.gz: 13bf91845d3591a7df8206ab1730c5db0d4350b92678ec393f60567956788da03e127dca649a423024db467929a7f43e6d3fdd35dd46f8f30f58088dfa61e9af
|
@@ -0,0 +1,35 @@
|
|
1
|
+
aliases:
|
2
|
+
- &step_cache_restore_deps
|
3
|
+
restore_cache:
|
4
|
+
keys:
|
5
|
+
- drivy-rails-fluent-plugin-heroku-syslog-http-{{ .Branch }}-{{ .Revision }}
|
6
|
+
- drivy-rails-fluent-plugin-heroku-syslog-http-{{ .Branch }}
|
7
|
+
- drivy-rails-fluent-plugin-heroku-syslog-http-
|
8
|
+
- &step_cache_save_deps
|
9
|
+
save_cache:
|
10
|
+
key: drivy-rails-fluent-plugin-heroku-syslog-http-{{ .Branch }}-{{ .Revision }}
|
11
|
+
paths: [ vendor/bundle ]
|
12
|
+
- &step_bundler_install_deps
|
13
|
+
run: bundle install --path vendor/bundle --jobs=2 --without development:deployment
|
14
|
+
|
15
|
+
version: 2
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
docker:
|
19
|
+
- image: circleci/ruby:2.4
|
20
|
+
steps:
|
21
|
+
- checkout
|
22
|
+
- *step_cache_restore_deps
|
23
|
+
# Bundler install
|
24
|
+
- *step_bundler_install_deps
|
25
|
+
- run: bundle clean
|
26
|
+
- *step_cache_save_deps
|
27
|
+
# Run tests
|
28
|
+
- run: bundle exec rake
|
29
|
+
|
30
|
+
workflows:
|
31
|
+
version: 2
|
32
|
+
|
33
|
+
test-and-deploy:
|
34
|
+
jobs:
|
35
|
+
- checkout
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
Style/Documentation:
|
2
|
+
Enabled: false
|
3
|
+
|
4
|
+
Metrics/AbcSize:
|
5
|
+
Enabled: false
|
6
|
+
|
7
|
+
Metrics/ClassLength:
|
8
|
+
Enabled: false
|
9
|
+
|
10
|
+
Metrics/LineLength:
|
11
|
+
Enabled: false
|
12
|
+
|
13
|
+
Metrics/MethodLength:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
Metrics/PerceivedComplexity:
|
17
|
+
Enabled: false
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
Copyright (c) 2014-2018 Kazuyuki Honda
|
2
|
+
Copyright (c) 2108- Drivy
|
3
|
+
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
you may not use this file except in compliance with the License.
|
6
|
+
You may obtain a copy of the License at
|
7
|
+
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
See the License for the specific language governing permissions and
|
14
|
+
limitations under the License.
|
data/README.md
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
# fluent-plugin-heroku-syslog-http
|
2
|
+
|
3
|
+
Plugins to accept and parse syslog input from [heroku http(s) drains](https://devcenter.heroku.com/articles/log-drains#http-s-drains), based on fluentd'd [http input](https://docs.fluentd.org/v1.0/articles/in_http) and [regexp parser](https://docs.fluentd.org/v1.0/articles/parser_regexp)
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Install with gem or fluent-gem command as:
|
8
|
+
|
9
|
+
```
|
10
|
+
# for fluentd
|
11
|
+
$ gem install fluent-plugin-heroku-syslog-http
|
12
|
+
|
13
|
+
# for td-agent
|
14
|
+
$ sudo /usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-heroku-syslog-http
|
15
|
+
```
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
|
19
|
+
### Configure heroku_syslog_http input
|
20
|
+
|
21
|
+
```
|
22
|
+
<source>
|
23
|
+
type heroku_syslog_http
|
24
|
+
port 9880
|
25
|
+
bind 0.0.0.0
|
26
|
+
tag heroku
|
27
|
+
drain_ids ["YOUR-HEROKU-DRAIN-ID"] # optional
|
28
|
+
</source>
|
29
|
+
```
|
30
|
+
|
31
|
+
### Example
|
32
|
+
|
33
|
+
Heroku's http syslog format:
|
34
|
+
`00 <13>1 2014-01-01T01:23:45.123456+00:00 host app web.1 - foo`
|
35
|
+
|
36
|
+
Will parse the following key/values:
|
37
|
+
```
|
38
|
+
{
|
39
|
+
'syslog.pri' => '13',
|
40
|
+
'syslog.facility' => 'user',
|
41
|
+
'syslog.severity' => 'notice',
|
42
|
+
'syslog.hostname' => 'host',
|
43
|
+
'syslog.appname' => 'app',
|
44
|
+
'syslog.procid' => 'web.1',
|
45
|
+
'syslog.timestamp' => '2014-01-29T06:25:52.589365+00:00',
|
46
|
+
'message' => 'foo'
|
47
|
+
}
|
48
|
+
```
|
49
|
+
|
50
|
+
|
51
|
+
## Copyright
|
52
|
+
|
53
|
+
- Copyright
|
54
|
+
- Copytight(C) 2018- Drivy
|
55
|
+
- Copyright(C) 2014-2018 Kazuyuki Honda (hakobera)
|
56
|
+
- License
|
57
|
+
- Apache License, Version 2.0
|
data/Rakefile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Gem::Specification.new do |gem|
|
4
|
+
gem.name = 'fluent-plugin-heroku-syslog-http'
|
5
|
+
gem.version = '0.2.0'
|
6
|
+
gem.authors = ['Drivy', 'Kazuyuki Honda']
|
7
|
+
gem.email = ['sre@drivy.com']
|
8
|
+
gem.description = 'fluent plugin to drain heroku syslog'
|
9
|
+
gem.summary = 'fluent plugin to drain heroku syslog'
|
10
|
+
gem.homepage = 'https://github.com/drivy/fluent-plugin-heroku-syslog-http'
|
11
|
+
gem.license = 'APLv2'
|
12
|
+
|
13
|
+
gem.files = `git ls-files`.split($ORS)
|
14
|
+
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
15
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
16
|
+
gem.require_paths = ['lib']
|
17
|
+
|
18
|
+
gem.add_runtime_dependency 'fluentd', '>= 1.0.0'
|
19
|
+
gem.add_development_dependency 'rake'
|
20
|
+
gem.add_development_dependency('test-unit', ['~> 3.1.0'])
|
21
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'fluent/plugin/in_http'
|
4
|
+
|
5
|
+
module Fluent
|
6
|
+
module Plugin
|
7
|
+
class HerokuSyslogHttpInput < HttpInput
|
8
|
+
Fluent::Plugin.register_input('heroku_syslog_http', self)
|
9
|
+
|
10
|
+
config_section :parse do
|
11
|
+
config_set_default :@type, 'heroku_syslog_http'
|
12
|
+
end
|
13
|
+
config_param :drain_ids, :array, default: nil
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def parse_params_with_parser(params)
|
18
|
+
content = params[EVENT_RECORD_PARAMETER]
|
19
|
+
raise "'#{EVENT_RECORD_PARAMETER}' parameter is required" unless content
|
20
|
+
|
21
|
+
records = []
|
22
|
+
messages = content.split("\n")
|
23
|
+
messages.each do |msg|
|
24
|
+
@parser.parse(msg) do |time, record|
|
25
|
+
raise "Could not parse event: #{content}" if record.nil?
|
26
|
+
|
27
|
+
record['syslog.timestamp'] ||= Time.at(time).utc.strftime('%Y-%m-%dT%H:%M:%S%z')
|
28
|
+
record['logplex.drain_id'] = params['HTTP_LOGPLEX_DRAIN_TOKEN']
|
29
|
+
record['logplex.frame_id'] = params['HTTP_LOGPLEX_FRAME_ID']
|
30
|
+
unless @drain_ids.nil? || @drain_ids.include?(record['logplex.drain_id'])
|
31
|
+
log.warn "drain_id not match: #{msg.inspect}"
|
32
|
+
next
|
33
|
+
end
|
34
|
+
records << record
|
35
|
+
end
|
36
|
+
end
|
37
|
+
[nil, records]
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'fluent/plugin/in_http'
|
4
|
+
require 'fluent/plugin/parser_regexp'
|
5
|
+
|
6
|
+
module Fluent
|
7
|
+
module Plugin
|
8
|
+
class HerokuSyslogHttpParser < RegexpParser
|
9
|
+
Fluent::Plugin.register_parser('heroku_syslog_http', self)
|
10
|
+
|
11
|
+
SYSLOG_HTTP_REGEXP = %r{^([0-9]+) +\<(?<syslog.pri>[0-9]+)\>([0-9]+) (?<syslog.timestamp>[^ ]+) (?<syslog.hostname>[^ ]+) (?<syslog.appname>[^ ]+) (?<syslog.procid>[^ ]+) - *(?<message>.*)$}
|
12
|
+
|
13
|
+
FACILITY_MAP = {
|
14
|
+
0 => 'kern',
|
15
|
+
1 => 'user',
|
16
|
+
2 => 'mail',
|
17
|
+
3 => 'daemon',
|
18
|
+
4 => 'auth',
|
19
|
+
5 => 'syslog',
|
20
|
+
6 => 'lpr',
|
21
|
+
7 => 'news',
|
22
|
+
8 => 'uucp',
|
23
|
+
9 => 'cron',
|
24
|
+
10 => 'authpriv',
|
25
|
+
11 => 'ftp',
|
26
|
+
12 => 'ntp',
|
27
|
+
13 => 'audit',
|
28
|
+
14 => 'alert',
|
29
|
+
15 => 'at',
|
30
|
+
16 => 'local0',
|
31
|
+
17 => 'local1',
|
32
|
+
18 => 'local2',
|
33
|
+
19 => 'local3',
|
34
|
+
20 => 'local4',
|
35
|
+
21 => 'local5',
|
36
|
+
22 => 'local6',
|
37
|
+
23 => 'local7'
|
38
|
+
}.freeze
|
39
|
+
|
40
|
+
SEVERITY_MAP = {
|
41
|
+
0 => 'emerg',
|
42
|
+
1 => 'alert',
|
43
|
+
2 => 'crit',
|
44
|
+
3 => 'err',
|
45
|
+
4 => 'warn',
|
46
|
+
5 => 'notice',
|
47
|
+
6 => 'info',
|
48
|
+
7 => 'debug'
|
49
|
+
}.freeze
|
50
|
+
|
51
|
+
config_set_default :expression, SYSLOG_HTTP_REGEXP
|
52
|
+
config_set_default :time_key, 'syslog.timestamp'
|
53
|
+
config_set_default :keep_time_key, true
|
54
|
+
|
55
|
+
def parse_prival(record)
|
56
|
+
if record && record['syslog.pri']
|
57
|
+
pri = record['syslog.pri'].to_i
|
58
|
+
record['syslog.facility'] = FACILITY_MAP[pri >> 3]
|
59
|
+
record['syslog.severity'] = SEVERITY_MAP[pri & 0b111]
|
60
|
+
end
|
61
|
+
record
|
62
|
+
end
|
63
|
+
|
64
|
+
def parse(text)
|
65
|
+
super(text) do |time, record|
|
66
|
+
yield time, parse_prival(record)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
data/test/helper.rb
ADDED
@@ -0,0 +1,144 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'helper'
|
4
|
+
require 'fluent/test/driver/input'
|
5
|
+
require 'fluent/plugin/in_heroku_syslog_http'
|
6
|
+
|
7
|
+
require 'net/http'
|
8
|
+
|
9
|
+
class HerokuSyslogHttpInputTest < Test::Unit::TestCase
|
10
|
+
class << self
|
11
|
+
def startup
|
12
|
+
socket_manager_path = ServerEngine::SocketManager::Server.generate_path
|
13
|
+
@server = ServerEngine::SocketManager::Server.open(socket_manager_path)
|
14
|
+
ENV['SERVERENGINE_SOCKETMANAGER_PATH'] = socket_manager_path.to_s
|
15
|
+
end
|
16
|
+
|
17
|
+
def shutdown
|
18
|
+
@server.close
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def setup
|
23
|
+
Fluent::Test.setup
|
24
|
+
end
|
25
|
+
|
26
|
+
PORT = unused_port
|
27
|
+
CONFIG = %(
|
28
|
+
@type heroku_syslog_http
|
29
|
+
port #{PORT}
|
30
|
+
bind 127.0.0.1
|
31
|
+
body_size_limit 10m
|
32
|
+
keepalive_timeout 5
|
33
|
+
)
|
34
|
+
|
35
|
+
def create_driver(conf = CONFIG)
|
36
|
+
Fluent::Test::Driver::Input.new(Fluent::Plugin::HerokuSyslogHttpInput).configure(conf)
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_configure
|
40
|
+
d = create_driver
|
41
|
+
assert_equal PORT, d.instance.port
|
42
|
+
assert_equal '127.0.0.1', d.instance.bind
|
43
|
+
assert_equal 10 * 1024 * 1024, d.instance.body_size_limit
|
44
|
+
assert_equal 5, d.instance.keepalive_timeout
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_time_format
|
48
|
+
messages = [
|
49
|
+
'59 <13>1 2014-01-29T06:25:52.589365+00:00 host app web.1 - foo',
|
50
|
+
'59 <13>1 2014-01-30T07:35:00.123456+09:00 host app web.1 - bar'
|
51
|
+
]
|
52
|
+
event_times = [
|
53
|
+
Time.strptime('2014-01-29T06:25:52+00:00', '%Y-%m-%dT%H:%M:%S%z').to_i,
|
54
|
+
Time.strptime('2014-01-30T07:35:00+09:00', '%Y-%m-%dT%H:%M:%S%z').to_i
|
55
|
+
]
|
56
|
+
|
57
|
+
d = create_driver
|
58
|
+
d.run(expect_records: 2, timeout: 5) do
|
59
|
+
res = post(messages)
|
60
|
+
assert_equal '', res.body
|
61
|
+
assert_equal '200', res.code
|
62
|
+
end
|
63
|
+
|
64
|
+
assert_equal event_times[0], d.events[0][1]
|
65
|
+
assert_equal event_times[1], d.events[1][1]
|
66
|
+
end
|
67
|
+
|
68
|
+
def test_msg_size
|
69
|
+
messages = [
|
70
|
+
'00 <13>1 2014-01-01T01:23:45.123456+00:00 host app web.1 - ' + 'x' * 100,
|
71
|
+
'00 <13>1 2014-01-01T01:23:45.123456+00:00 host app web.1 - ' + 'x' * 1024
|
72
|
+
]
|
73
|
+
|
74
|
+
d = create_driver
|
75
|
+
d.run(expect_records: 2, timeout: 5) do
|
76
|
+
res = post(messages)
|
77
|
+
assert_equal '200', res.code
|
78
|
+
end
|
79
|
+
|
80
|
+
assert_equal 'x' * 100, d.events[0][2]['message']
|
81
|
+
assert_equal 'x' * 1024, d.events[1][2]['message']
|
82
|
+
end
|
83
|
+
|
84
|
+
def test_accept_matched_drain_id_multiple
|
85
|
+
messages = [
|
86
|
+
'00 <13>1 2014-01-01T01:23:45.123456+00:00 host app web.1 - foo',
|
87
|
+
'00 <13>1 2014-01-01T01:23:45.123456+00:00 host app web.1 - bar'
|
88
|
+
]
|
89
|
+
d = create_driver(CONFIG + %(
|
90
|
+
drain_ids ["abc", "d.fc6b856b-3332-4546-93de-7d0ee272c3bd"]
|
91
|
+
))
|
92
|
+
d.run(expect_records: 2, timeout: 5) do
|
93
|
+
res = post(messages)
|
94
|
+
assert_equal '200', res.code
|
95
|
+
end
|
96
|
+
|
97
|
+
assert_equal 2, d.events.length
|
98
|
+
end
|
99
|
+
|
100
|
+
def test_ignore_unmatched_drain_id
|
101
|
+
messages = [
|
102
|
+
'00 <13>1 2014-01-01T01:23:45.123456+00:00 host app web.1 - foo',
|
103
|
+
'00 <13>1 2014-01-01T01:23:45.123456+00:00 host app web.1 - bar'
|
104
|
+
]
|
105
|
+
d = create_driver(CONFIG + %(
|
106
|
+
drain_ids ["abc"]
|
107
|
+
))
|
108
|
+
d.run(expect_records: 0, timeout: 5) do
|
109
|
+
res = post(messages)
|
110
|
+
assert_equal '200', res.code
|
111
|
+
end
|
112
|
+
|
113
|
+
assert_equal 0, d.events.length
|
114
|
+
end
|
115
|
+
|
116
|
+
def test_logplex_metas
|
117
|
+
messages = [
|
118
|
+
'00 <13>1 2014-01-01T01:23:45.123456+00:00 host app web.1 - ' + 'x' * 100
|
119
|
+
]
|
120
|
+
d = create_driver
|
121
|
+
d.run(expect_records: 1, timeout: 5) do
|
122
|
+
res = post(messages)
|
123
|
+
assert_equal '200', res.code
|
124
|
+
end
|
125
|
+
|
126
|
+
assert_equal '09C557EAFCFB6CF2740EE62F62971098', d.events[0][2]['logplex.frame_id']
|
127
|
+
assert_equal 'd.fc6b856b-3332-4546-93de-7d0ee272c3bd', d.events[0][2]['logplex.drain_id']
|
128
|
+
end
|
129
|
+
|
130
|
+
def post(messages)
|
131
|
+
# https://github.com/heroku/logplex/blob/master/doc/README.http_drains.md
|
132
|
+
http = Net::HTTP.new('127.0.0.1', PORT)
|
133
|
+
headers = {
|
134
|
+
'Content-Type' => 'application/logplex-1',
|
135
|
+
'Logplex-Msg-Count' => messages.length.to_s,
|
136
|
+
'Logplex-Frame-Id' => '09C557EAFCFB6CF2740EE62F62971098',
|
137
|
+
'Logplex-Drain-Token' => 'd.fc6b856b-3332-4546-93de-7d0ee272c3bd',
|
138
|
+
'User-Agent' => 'Logplex/v49'
|
139
|
+
}
|
140
|
+
req = Net::HTTP::Post.new('/heroku', headers)
|
141
|
+
req.body = messages.join("\n")
|
142
|
+
http.request(req)
|
143
|
+
end
|
144
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'helper'
|
4
|
+
require 'fluent/test/driver/parser'
|
5
|
+
require 'fluent/plugin/in_heroku_syslog_http'
|
6
|
+
|
7
|
+
require 'net/http'
|
8
|
+
|
9
|
+
# Stolen from fluentd/test/helper.rb
|
10
|
+
class Hash
|
11
|
+
def corresponding_proxies
|
12
|
+
@corresponding_proxies ||= []
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_masked_element
|
16
|
+
self
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class HerokuSyslogHttpParseTest < Test::Unit::TestCase
|
21
|
+
def setup
|
22
|
+
Fluent::Test.setup
|
23
|
+
end
|
24
|
+
|
25
|
+
def create_driver(conf = {})
|
26
|
+
d = Struct.new(:instance).new
|
27
|
+
d.instance = Fluent::Plugin::HerokuSyslogHttpParser.new
|
28
|
+
d.instance.configure(conf)
|
29
|
+
d
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_parsing_with_default_conf
|
33
|
+
text = '59 <13>1 2014-01-29T06:25:52.589365+00:00 host app web.1 - foo'
|
34
|
+
expected_time = Time.strptime('2014-01-29T07:25:52+01:00', '%Y-%m-%dT%H:%M:%S%z').to_i
|
35
|
+
event = {
|
36
|
+
'syslog.pri' => '13',
|
37
|
+
'syslog.facility' => 'user',
|
38
|
+
'syslog.severity' => 'notice',
|
39
|
+
'syslog.hostname' => 'host',
|
40
|
+
'syslog.appname' => 'app',
|
41
|
+
'syslog.procid' => 'web.1',
|
42
|
+
'syslog.timestamp' => '2014-01-29T06:25:52.589365+00:00',
|
43
|
+
'message' => 'foo'
|
44
|
+
}
|
45
|
+
d = create_driver
|
46
|
+
d.instance.parse(text) do |time, record|
|
47
|
+
assert_equal expected_time, time
|
48
|
+
assert_equal event, record
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_parsing_pri_conf
|
53
|
+
d = create_driver
|
54
|
+
|
55
|
+
d.instance.parse('00 <13>1 2014-01-29T06:25:52.589365+00:00 host app web.1 - foo') do |_, record|
|
56
|
+
assert_equal 'notice', record['syslog.severity']
|
57
|
+
assert_equal 'user', record['syslog.facility']
|
58
|
+
end
|
59
|
+
d.instance.parse('00 <42>1 2014-01-29T06:25:52.589365+00:00 host app web.1 - foo') do |_, record|
|
60
|
+
assert_equal 'crit', record['syslog.severity']
|
61
|
+
assert_equal 'syslog', record['syslog.facility']
|
62
|
+
end
|
63
|
+
d.instance.parse('00 <27>1 2014-01-29T06:25:52.589365+00:00 host app web.1 - foo') do |_, record|
|
64
|
+
assert_equal 'err', record['syslog.severity']
|
65
|
+
assert_equal 'daemon', record['syslog.facility']
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
metadata
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fluent-plugin-heroku-syslog-http
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Drivy
|
8
|
+
- Kazuyuki Honda
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2018-10-15 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: fluentd
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 1.0.0
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 1.0.0
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rake
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: test-unit
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 3.1.0
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 3.1.0
|
56
|
+
description: fluent plugin to drain heroku syslog
|
57
|
+
email:
|
58
|
+
- sre@drivy.com
|
59
|
+
executables: []
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- ".circleci/config.yml"
|
64
|
+
- ".gitignore"
|
65
|
+
- ".rubocop.yml"
|
66
|
+
- Gemfile
|
67
|
+
- LICENSE.txt
|
68
|
+
- README.md
|
69
|
+
- Rakefile
|
70
|
+
- fluent-plugin-heroku-syslog.gemspec
|
71
|
+
- lib/fluent/plugin/in_heroku_syslog_http.rb
|
72
|
+
- lib/fluent/plugin/parser_heroku_syslog_http.rb
|
73
|
+
- test/helper.rb
|
74
|
+
- test/plugin/test_in_heroku_syslog_http.rb
|
75
|
+
- test/plugin/test_parser_heroku_syslog_http.rb
|
76
|
+
homepage: https://github.com/drivy/fluent-plugin-heroku-syslog-http
|
77
|
+
licenses:
|
78
|
+
- APLv2
|
79
|
+
metadata: {}
|
80
|
+
post_install_message:
|
81
|
+
rdoc_options: []
|
82
|
+
require_paths:
|
83
|
+
- lib
|
84
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
requirements: []
|
95
|
+
rubyforge_project:
|
96
|
+
rubygems_version: 2.7.7
|
97
|
+
signing_key:
|
98
|
+
specification_version: 4
|
99
|
+
summary: fluent plugin to drain heroku syslog
|
100
|
+
test_files:
|
101
|
+
- test/helper.rb
|
102
|
+
- test/plugin/test_in_heroku_syslog_http.rb
|
103
|
+
- test/plugin/test_parser_heroku_syslog_http.rb
|