fluent-plugin-rawexec 0.0.1
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 +7 -0
- data/.gitignore +3 -0
- data/Gemfile +6 -0
- data/History.md +7 -0
- data/LICENSE +22 -0
- data/README.md +9 -0
- data/Rakefile +11 -0
- data/fluent-plugin-rawexec.gemspec +23 -0
- data/lib/fluent/plugin/out_rawexec.rb +59 -0
- data/test/helper.rb +1 -0
- metadata +96 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c5d55c9f4ba6ebff89980ca7d7d7bb408fbd9295
|
4
|
+
data.tar.gz: b7f6bf2b43dbfb5c1a0d685036b7e0372d95a72e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c00630e1705ebdf162cbd3976678e29a396d6586e637374b02e0962e48f0b82275cdde7ca51f8bfeb1f446270a92169d1816902b596b88ca2ce8d4078d44f4e9
|
7
|
+
data.tar.gz: d6671db8a858380d07e9f85ce18181048a10abaac5319ce0d5449013215cc487ab4154a40de14211b9b78dbce2b9ab316e1e153fff694c4f77ca543ea3073d0d
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/History.md
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Fang.Li <surivlee@gmail.com>
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# Fluent::Plugin::Rawexec, a plugin for [Fluentd](http://fluentd.org)
|
2
|
+
|
3
|
+
fluent-plugin-rawexec is a buffered output plugin for fluentd.
|
4
|
+
|
5
|
+
The only difference between the offical out_exec is
|
6
|
+
|
7
|
+
**fluent-plugin-rawexec write raw message body into tmp file rather than filtered keys**
|
8
|
+
|
9
|
+
So there is no "keys" option in this plugin.
|
data/Rakefile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = "fluent-plugin-rawexec"
|
6
|
+
s.version = '0.0.1'
|
7
|
+
s.authors = ["FangLi"]
|
8
|
+
s.email = ["surivlee@gmail.com"]
|
9
|
+
s.description = %q{Execute user script with RAW message output plugin for Fluentd}
|
10
|
+
s.summary = %q{Execute user script with RAW message output plugin for Fluentd}
|
11
|
+
s.homepage = "https://github.com/fangli/fluent-plugin-rawexec"
|
12
|
+
s.license = 'MIT'
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split($/)
|
15
|
+
s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
16
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
|
19
|
+
s.add_runtime_dependency "fluentd"
|
20
|
+
|
21
|
+
s.add_development_dependency "rake"
|
22
|
+
s.add_development_dependency "webmock"
|
23
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
#
|
2
|
+
# Fluent
|
3
|
+
#
|
4
|
+
# Copyright (C) 2011 FURUHASHI Sadayuki
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
module Fluent
|
19
|
+
class RawExecOutput < TimeSlicedOutput
|
20
|
+
Plugin.register_output('rawexec', self)
|
21
|
+
|
22
|
+
def initialize
|
23
|
+
super
|
24
|
+
require 'tempfile'
|
25
|
+
@localtime = false
|
26
|
+
end
|
27
|
+
|
28
|
+
config_param :command, :string
|
29
|
+
|
30
|
+
def configure(conf)
|
31
|
+
super
|
32
|
+
|
33
|
+
def format(tag, time, record)
|
34
|
+
out = ''
|
35
|
+
out << record.to_s
|
36
|
+
out << "\n"
|
37
|
+
out
|
38
|
+
end
|
39
|
+
|
40
|
+
def write(chunk)
|
41
|
+
if chunk.respond_to?(:path)
|
42
|
+
prog = "#{@command} #{chunk.path}"
|
43
|
+
else
|
44
|
+
tmpfile = Tempfile.new("fluent-plugin-rawexec-")
|
45
|
+
chunk.write_to(tmpfile)
|
46
|
+
tmpfile.close
|
47
|
+
prog = "#{@command} #{tmpfile.path}"
|
48
|
+
end
|
49
|
+
|
50
|
+
system(prog)
|
51
|
+
ecode = $?.to_i
|
52
|
+
tmpfile.delete if tmpfile
|
53
|
+
|
54
|
+
if ecode != 0
|
55
|
+
raise "command returns #{ecode}: #{prog}"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
data/test/helper.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'minitest/pride'
|
metadata
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fluent-plugin-rawexec
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- FangLi
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-02-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: fluentd
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: webmock
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Execute user script with RAW message output plugin for Fluentd
|
56
|
+
email:
|
57
|
+
- surivlee@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- .gitignore
|
63
|
+
- Gemfile
|
64
|
+
- History.md
|
65
|
+
- LICENSE
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- fluent-plugin-rawexec.gemspec
|
69
|
+
- lib/fluent/plugin/out_rawexec.rb
|
70
|
+
- test/helper.rb
|
71
|
+
homepage: https://github.com/fangli/fluent-plugin-rawexec
|
72
|
+
licenses:
|
73
|
+
- MIT
|
74
|
+
metadata: {}
|
75
|
+
post_install_message:
|
76
|
+
rdoc_options: []
|
77
|
+
require_paths:
|
78
|
+
- lib
|
79
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - '>='
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - '>='
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
requirements: []
|
90
|
+
rubyforge_project:
|
91
|
+
rubygems_version: 2.0.3
|
92
|
+
signing_key:
|
93
|
+
specification_version: 4
|
94
|
+
summary: Execute user script with RAW message output plugin for Fluentd
|
95
|
+
test_files:
|
96
|
+
- test/helper.rb
|