fluent-plugin-out-file-with-fix-path 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile +4 -0
- data/README.md +22 -0
- data/Rakefile +4 -0
- data/fluent-plugin-out-file-with-fix-path.gemspec +24 -0
- data/lib/fluent/plugin/out_file_with_fix_path.rb +43 -0
- metadata +88 -0
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
pkg/
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# Fluent::Plugin::FileOutputWithFixPath
|
2
|
+
|
3
|
+
This plugin is extention of fluentd out_file plugin.
|
4
|
+
|
5
|
+
This plugin has same functions to the default out_file plugin except that file path is fixed.
|
6
|
+
|
7
|
+
If you use out_file plugin, file path is `path + time_format + ".log"`.
|
8
|
+
|
9
|
+
But if you use this plugin, file path is just `path`.
|
10
|
+
|
11
|
+
Therefore `time_format` and `compress` option are not available.
|
12
|
+
|
13
|
+
## Installation
|
14
|
+
|
15
|
+
$ gem install fluent-plugin-out-file-with-fix-path
|
16
|
+
|
17
|
+
## Sample
|
18
|
+
|
19
|
+
<match td.test>
|
20
|
+
type file_with_fix_path
|
21
|
+
path /var/log/hoge.log
|
22
|
+
</match>
|
data/Rakefile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.name = "fluent-plugin-out-file-with-fix-path"
|
6
|
+
gem.version = "0.0.1"
|
7
|
+
gem.date = '2014-09-19'
|
8
|
+
gem.authors = ["fetaro"]
|
9
|
+
gem.email = ["fetaro@gmail.com"]
|
10
|
+
gem.summary = %q{Extention of fluentd out_file plugin }
|
11
|
+
gem.description = %q{FLuentd plugin for SNMP Traps... WIP}
|
12
|
+
gem.homepage = 'https://github.com/fetaro/fluent-plugin-out-file-with-fix-path.git'
|
13
|
+
gem.license = 'MIT'
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($\)
|
16
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
17
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
|
20
|
+
gem.add_development_dependency "rake", '~> 0.9', '>= 0.9.6'
|
21
|
+
|
22
|
+
gem.add_runtime_dependency "fluentd", '~> 0.10', '>= 0.10.51'
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Fluent
|
2
|
+
class FileOutputWithFixPath < TimeSlicedOutput
|
3
|
+
Plugin.register_output('file_with_fix_path', self)
|
4
|
+
config_param :path, :string
|
5
|
+
config_param :format, :string, :default => 'out_file'
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
require 'time'
|
9
|
+
super
|
10
|
+
end
|
11
|
+
|
12
|
+
def configure(conf)
|
13
|
+
if path = conf['path']
|
14
|
+
@path = path
|
15
|
+
end
|
16
|
+
unless @path
|
17
|
+
raise ConfigError, "'path' parameter is required on file output"
|
18
|
+
end
|
19
|
+
conf['buffer_path'] ||= @path
|
20
|
+
super
|
21
|
+
|
22
|
+
conf['format'] = @format
|
23
|
+
@formatter = TextFormatter.create(conf)
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
def format(tag, time, record)
|
28
|
+
@formatter.format(tag, time, record)
|
29
|
+
end
|
30
|
+
|
31
|
+
def write(chunk)
|
32
|
+
FileUtils.mkdir_p File.dirname(@path)
|
33
|
+
File.open(@path, "a", DEFAULT_FILE_PERMISSION) do |f|
|
34
|
+
chunk.write_to(f)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def secondary_init(primary)
|
39
|
+
# don't warn even if primary.class is not FileOutput
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|
metadata
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fluent-plugin-out-file-with-fix-path
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.1
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- fetaro
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2014-09-19 00:00:00 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rake
|
17
|
+
prerelease: false
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ~>
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0.9"
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.9.6
|
27
|
+
type: :development
|
28
|
+
version_requirements: *id001
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: fluentd
|
31
|
+
prerelease: false
|
32
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: "0.10"
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.10.51
|
41
|
+
type: :runtime
|
42
|
+
version_requirements: *id002
|
43
|
+
description: FLuentd plugin for SNMP Traps... WIP
|
44
|
+
email:
|
45
|
+
- fetaro@gmail.com
|
46
|
+
executables: []
|
47
|
+
|
48
|
+
extensions: []
|
49
|
+
|
50
|
+
extra_rdoc_files: []
|
51
|
+
|
52
|
+
files:
|
53
|
+
- .gitignore
|
54
|
+
- Gemfile
|
55
|
+
- README.md
|
56
|
+
- Rakefile
|
57
|
+
- fluent-plugin-out-file-with-fix-path.gemspec
|
58
|
+
- lib/fluent/plugin/out_file_with_fix_path.rb
|
59
|
+
homepage: https://github.com/fetaro/fluent-plugin-out-file-with-fix-path.git
|
60
|
+
licenses:
|
61
|
+
- MIT
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options: []
|
64
|
+
|
65
|
+
require_paths:
|
66
|
+
- lib
|
67
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: "0"
|
73
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: "0"
|
79
|
+
requirements: []
|
80
|
+
|
81
|
+
rubyforge_project:
|
82
|
+
rubygems_version: 1.7.1
|
83
|
+
signing_key:
|
84
|
+
specification_version: 3
|
85
|
+
summary: Extention of fluentd out_file plugin
|
86
|
+
test_files: []
|
87
|
+
|
88
|
+
has_rdoc:
|