mirror of
https://github.com/fluent/fluentd-ui.git
synced 2026-05-05 19:06:12 +02:00
Add controllers/models snippet for filter plugins
Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
parent
19d62678b5
commit
feafc35d48
@ -0,0 +1,9 @@
|
||||
class Fluentd::Settings::FilterGrepController < ApplicationController
|
||||
include SettingConcern
|
||||
|
||||
private
|
||||
|
||||
def target_class
|
||||
Fluentd::Setting::FilterGrep
|
||||
end
|
||||
end
|
||||
@ -0,0 +1,9 @@
|
||||
class Fluentd::Settings::FilterParserController < ApplicationController
|
||||
include SettingConcern
|
||||
|
||||
private
|
||||
|
||||
def target_class
|
||||
Fluentd::Setting::FilterParser
|
||||
end
|
||||
end
|
||||
@ -0,0 +1,9 @@
|
||||
class Fluentd::Settings::FilterRecordTransformerController < ApplicationController
|
||||
include SettingConcern
|
||||
|
||||
private
|
||||
|
||||
def target_class
|
||||
Fluentd::Setting::FilterRecordTransformer
|
||||
end
|
||||
end
|
||||
@ -0,0 +1,9 @@
|
||||
class Fluentd::Settings::FilterStdoutController < ApplicationController
|
||||
include SettingConcern
|
||||
|
||||
private
|
||||
|
||||
def target_class
|
||||
Fluentd::Setting::FilterStdout
|
||||
end
|
||||
end
|
||||
28
app/models/fluentd/setting/filter_grep.rb
Normal file
28
app/models/fluentd/setting/filter_grep.rb
Normal file
@ -0,0 +1,28 @@
|
||||
class Fluentd
|
||||
module Setting
|
||||
class FilterGrep
|
||||
include Fluentd::Setting::Plugin
|
||||
|
||||
register_plugin("filter", "grep")
|
||||
|
||||
def self.initial_params
|
||||
{
|
||||
}
|
||||
end
|
||||
|
||||
def common_options
|
||||
[
|
||||
:pattern,
|
||||
]
|
||||
end
|
||||
|
||||
def hidden_options
|
||||
regexps = (1..20).map {|n| :"regexp#{n}"}
|
||||
excludes = (1..20).map {|n| :"exclude#{n}"}
|
||||
[
|
||||
*regexps, *excludes, :regexp, :exclude, :and, :or
|
||||
].tap{|s| p s}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
24
app/models/fluentd/setting/filter_parser.rb
Normal file
24
app/models/fluentd/setting/filter_parser.rb
Normal file
@ -0,0 +1,24 @@
|
||||
class Fluentd
|
||||
module Setting
|
||||
class FilterParser
|
||||
include Fluentd::Setting::Plugin
|
||||
|
||||
register_plugin("filter", "parser")
|
||||
|
||||
def self.initial_params
|
||||
{
|
||||
}
|
||||
end
|
||||
|
||||
def common_options
|
||||
[
|
||||
:pattern,
|
||||
]
|
||||
end
|
||||
|
||||
def hidden_options
|
||||
[]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
24
app/models/fluentd/setting/filter_record_transformer.rb
Normal file
24
app/models/fluentd/setting/filter_record_transformer.rb
Normal file
@ -0,0 +1,24 @@
|
||||
class Fluentd
|
||||
module Setting
|
||||
class FilterRecordTransformer
|
||||
include Fluentd::Setting::Plugin
|
||||
|
||||
register_plugin("filter", "record_transformer")
|
||||
|
||||
def self.initial_params
|
||||
{
|
||||
}
|
||||
end
|
||||
|
||||
def common_options
|
||||
[
|
||||
:pattern,
|
||||
]
|
||||
end
|
||||
|
||||
def hidden_options
|
||||
[]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
33
app/models/fluentd/setting/filter_stdout.rb
Normal file
33
app/models/fluentd/setting/filter_stdout.rb
Normal file
@ -0,0 +1,33 @@
|
||||
class Fluentd
|
||||
module Setting
|
||||
class FilterStdout
|
||||
include Fluentd::Setting::Plugin
|
||||
|
||||
register_plugin("filter", "stdout")
|
||||
|
||||
def self.initial_params
|
||||
{
|
||||
format_type: "stdout",
|
||||
format: {
|
||||
"0" => {
|
||||
"@type" => "stdout",
|
||||
"output_type" => "json"
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
def common_options
|
||||
[
|
||||
:pattern,
|
||||
]
|
||||
end
|
||||
|
||||
def hidden_options
|
||||
[
|
||||
:inject
|
||||
]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user