fluentd-ui 1.0.0.alpha.2 → 1.0.0.alpha.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fluentd-ui might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/ChangeLog.md +5 -0
- data/Gemfile.lock +56 -1
- data/README.md +2 -2
- data/app/controllers/api/config_definitions_controller.rb +55 -0
- data/app/controllers/api_controller.rb +20 -3
- data/app/controllers/concerns/setting_concern.rb +18 -2
- data/app/controllers/fluentd/settings/in_tail_controller.rb +13 -5
- data/app/controllers/fluentd/settings/out_forward_controller.rb +0 -9
- data/app/controllers/fluentd/settings/out_s3_controller.rb +0 -5
- data/app/controllers/fluentd/settings/out_tdlog_controller.rb +9 -0
- data/app/form_builders/fluentd_form_builder.rb +83 -0
- data/app/helpers/settings_helper.rb +81 -18
- data/app/javascript/packs/application.js +4 -0
- data/app/javascript/packs/in_tail_parse.js +159 -0
- data/app/javascript/packs/owned_plugin_form.js +141 -0
- data/app/javascript/packs/parser_multiline_form.js +51 -0
- data/app/javascript/packs/plugin_setting.js +19 -0
- data/app/models/concerns/fluentd/setting/configurable.rb +113 -0
- data/app/models/concerns/fluentd/setting/pattern.rb +11 -0
- data/app/models/concerns/fluentd/setting/plugin.rb +78 -0
- data/app/models/concerns/fluentd/setting/plugin_config.rb +74 -0
- data/app/models/concerns/fluentd/setting/plugin_parameter.rb +121 -0
- data/app/models/concerns/fluentd/setting/section_parser.rb +36 -0
- data/app/models/concerns/fluentd/setting/section_validator.rb +21 -0
- data/app/models/fluentd.rb +5 -5
- data/app/models/fluentd/setting/buffer_file.rb +23 -0
- data/app/models/fluentd/setting/buffer_memory.rb +17 -0
- data/app/models/fluentd/setting/formatter_csv.rb +21 -0
- data/app/models/fluentd/setting/formatter_hash.rb +19 -0
- data/app/models/fluentd/setting/formatter_json.rb +25 -0
- data/app/models/fluentd/setting/formatter_ltsv.rb +21 -0
- data/app/models/fluentd/setting/formatter_msgpack.rb +13 -0
- data/app/models/fluentd/setting/formatter_out_file.rb +21 -0
- data/app/models/fluentd/setting/formatter_single_value.rb +20 -0
- data/app/models/fluentd/setting/formatter_stdout.rb +19 -0
- data/app/models/fluentd/setting/formatter_tsv.rb +21 -0
- data/app/models/fluentd/setting/in_forward.rb +7 -17
- data/app/models/fluentd/setting/in_http.rb +13 -19
- data/app/models/fluentd/setting/in_monitor_agent.rb +6 -19
- data/app/models/fluentd/setting/in_syslog.rb +14 -12
- data/app/models/fluentd/setting/in_tail.rb +7 -84
- data/app/models/fluentd/setting/out_elasticsearch.rb +12 -21
- data/app/models/fluentd/setting/out_forward.rb +22 -66
- data/app/models/fluentd/setting/out_mongo.rb +20 -26
- data/app/models/fluentd/setting/out_s3.rb +18 -30
- data/app/models/fluentd/setting/out_stdout.rb +21 -18
- data/app/models/fluentd/setting/out_tdlog.rb +35 -0
- data/app/models/fluentd/setting/parser_apache.rb +13 -0
- data/app/models/fluentd/setting/parser_apache2.rb +13 -0
- data/app/models/fluentd/setting/parser_apache_error.rb +13 -0
- data/app/models/fluentd/setting/parser_csv.rb +22 -0
- data/app/models/fluentd/setting/parser_in_http.rb +13 -0
- data/app/models/fluentd/setting/parser_json.rb +25 -0
- data/app/models/fluentd/setting/parser_ltsv.rb +30 -0
- data/app/models/fluentd/setting/parser_msgpack.rb +13 -0
- data/app/models/fluentd/setting/parser_multiline.rb +24 -0
- data/app/models/fluentd/setting/parser_nginx.rb +13 -0
- data/app/models/fluentd/setting/parser_none.rb +19 -0
- data/app/models/fluentd/setting/parser_regexp.rb +26 -0
- data/app/models/fluentd/setting/parser_syslog.rb +29 -0
- data/app/models/fluentd/setting/parser_tsv.rb +19 -0
- data/app/models/fluentd/setting/section.rb +38 -0
- data/app/models/fluentd/setting/storage_local.rb +22 -0
- data/app/models/fluentd/setting/type/array.rb +17 -0
- data/app/models/fluentd/setting/type/bool.rb +18 -0
- data/app/models/fluentd/setting/type/enum.rb +17 -0
- data/app/models/fluentd/setting/type/hash.rb +17 -0
- data/app/models/fluentd/setting/type/regexp.rb +17 -0
- data/app/models/fluentd/setting/type/section.rb +17 -0
- data/app/models/fluentd/setting/type/size.rb +17 -0
- data/app/models/fluentd/setting/type/time.rb +17 -0
- data/app/views/api/settings/_element.json.jbuilder +1 -1
- data/app/views/fluentd/settings/in_forward/_form.html.haml +16 -0
- data/app/views/fluentd/settings/in_tail/_form.html.haml +22 -29
- data/app/views/fluentd/settings/in_tail/after_file_choose.html.haml +1 -1
- data/app/views/fluentd/settings/in_tail/after_format.html.haml +4 -4
- data/app/views/fluentd/settings/in_tail/confirm.html.haml +5 -5
- data/app/views/fluentd/settings/source_and_output.html.haml +1 -1
- data/app/views/shared/_global_nav.html.erb +8 -8
- data/app/views/shared/settings/_form.html.haml +40 -9
- data/app/views/shared/settings/show.html.haml +4 -1
- data/app/views/shared/vue/_in_tail_parse.html.haml +20 -0
- data/app/views/shared/vue/_owned_plugin_form.html.haml +68 -0
- data/app/views/shared/vue/_parser_multiline_form.html.haml +19 -0
- data/app/views/shared/vue/_setting.html.erb +1 -1
- data/config/application.rb +1 -1
- data/config/environment.rb +3 -0
- data/config/initializers/types.rb +7 -0
- data/config/routes.rb +2 -1
- data/fluentd-ui.gemspec +5 -0
- data/lib/fluentd-ui/version.rb +1 -1
- data/lib/regexp_preview.rb +2 -2
- data/lib/regexp_preview/multi_line.rb +53 -63
- data/lib/regexp_preview/single_line.rb +40 -46
- data/spec/features/fluentd/setting/out_forward_spec.rb +1 -1
- data/spec/features/fluentd/setting/out_stdout_spec.rb +1 -1
- data/spec/features/{out_td_spec.rb → out_tdlog_spec.rb} +3 -3
- data/spec/lib/regexp_preview/multi_line_spec.rb +29 -34
- data/spec/lib/regexp_preview/single_line_spec.rb +89 -87
- data/spec/models/fluentd/setting/in_forward_spec.rb +75 -0
- data/spec/models/fluentd/setting/in_http_spec.rb +31 -0
- data/spec/models/fluentd/setting/in_monitor_agent_spec.rb +31 -0
- data/spec/models/fluentd/setting/in_syslog_spec.rb +65 -7
- data/spec/models/fluentd/setting/in_tail_spec.rb +47 -0
- data/spec/models/fluentd/setting/out_elasticsearch_spec.rb +31 -0
- data/spec/models/fluentd/setting/out_mongo_spec.rb +35 -12
- data/spec/models/fluentd/setting/out_s3_spec.rb +128 -0
- data/spec/models/fluentd/setting/out_stdout_spec.rb +31 -0
- data/spec/models/fluentd/setting/out_tdlog_spec.rb +47 -0
- metadata +164 -38
- data/app/controllers/fluentd/settings/out_td_controller.rb +0 -18
- data/app/helpers/fluentd/settings_helper.rb +0 -2
- data/app/javascript/packs/in_tail_format.js +0 -174
- data/app/models/fluentd/setting/common.rb +0 -185
- data/app/models/fluentd/setting/out_td.rb +0 -48
- data/app/views/shared/vue/_in_tail_format.html.erb +0 -43
- data/spec/models/fluentd/setting/common_spec.rb +0 -178
- data/spec/models/fluentd/setting/out_td_spec.rb +0 -38
@@ -1,36 +1,39 @@
|
|
1
1
|
class Fluentd
|
2
2
|
module Setting
|
3
3
|
class OutStdout
|
4
|
-
include
|
4
|
+
include Fluentd::Setting::Plugin
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
attr_accessor(*KEYS)
|
9
|
-
|
10
|
-
choice :output_type, %w(json hash)
|
11
|
-
|
12
|
-
validates :match, presence: true
|
13
|
-
validates :output_type, inclusion: { in: %w(json hash) }
|
6
|
+
register_plugin("output", "stdout")
|
14
7
|
|
15
8
|
def self.initial_params
|
16
9
|
{
|
17
|
-
|
18
|
-
|
10
|
+
pattern: "debug.**",
|
11
|
+
buffer_type: "memory",
|
12
|
+
buffer: {
|
13
|
+
"0" => {
|
14
|
+
"type" => "memory",
|
15
|
+
}
|
16
|
+
},
|
17
|
+
format_type: "stdout",
|
18
|
+
format: {
|
19
|
+
"0" => {
|
20
|
+
"@type" => "stdout",
|
21
|
+
"output_type" => "json"
|
22
|
+
}
|
23
|
+
}
|
19
24
|
}
|
20
25
|
end
|
21
26
|
|
22
27
|
def common_options
|
23
28
|
[
|
24
|
-
:
|
29
|
+
:pattern, :output_type
|
25
30
|
]
|
26
31
|
end
|
27
32
|
|
28
|
-
def
|
29
|
-
[
|
30
|
-
|
31
|
-
|
32
|
-
def plugin_name
|
33
|
-
"stdout"
|
33
|
+
def hidden_options
|
34
|
+
[
|
35
|
+
:secondary, :inject, :buffer
|
36
|
+
]
|
34
37
|
end
|
35
38
|
end
|
36
39
|
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
class OutTdlog
|
4
|
+
include Fluentd::Setting::Plugin
|
5
|
+
|
6
|
+
register_plugin("output", "tdlog")
|
7
|
+
|
8
|
+
def self.initial_params
|
9
|
+
{
|
10
|
+
pattern: "td.*.*",
|
11
|
+
buffer_type: "file",
|
12
|
+
buffer: {
|
13
|
+
"0" => {
|
14
|
+
"@type" => "file",
|
15
|
+
"path" => "/var/log/td-agent/buffer/td",
|
16
|
+
}
|
17
|
+
},
|
18
|
+
auto_create_table: true,
|
19
|
+
}
|
20
|
+
end
|
21
|
+
|
22
|
+
def common_options
|
23
|
+
[
|
24
|
+
:pattern, :apikey, :auto_create_table, :database, :table,
|
25
|
+
]
|
26
|
+
end
|
27
|
+
|
28
|
+
def hidden_options
|
29
|
+
[
|
30
|
+
:secondary
|
31
|
+
]
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
class ParserCsv
|
4
|
+
include Fluentd::Setting::Plugin
|
5
|
+
|
6
|
+
register_plugin("parser", "csv")
|
7
|
+
|
8
|
+
def self.initial_params
|
9
|
+
{
|
10
|
+
keys: nil,
|
11
|
+
delimiter: ","
|
12
|
+
}
|
13
|
+
end
|
14
|
+
|
15
|
+
def common_options
|
16
|
+
[
|
17
|
+
:keys, :delimiter
|
18
|
+
]
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
class ParserJson
|
4
|
+
include Fluentd::Setting::Plugin
|
5
|
+
|
6
|
+
register_plugin("parser", "json")
|
7
|
+
|
8
|
+
def self.initial_params
|
9
|
+
{
|
10
|
+
json_parser: "oj"
|
11
|
+
}
|
12
|
+
end
|
13
|
+
|
14
|
+
def common_options
|
15
|
+
[]
|
16
|
+
end
|
17
|
+
|
18
|
+
def advanced_options
|
19
|
+
[
|
20
|
+
:json_parser
|
21
|
+
]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
class ParserLtsv
|
4
|
+
include Fluentd::Setting::Plugin
|
5
|
+
|
6
|
+
register_plugin("parser", "ltsv")
|
7
|
+
|
8
|
+
def self.initial_params
|
9
|
+
{
|
10
|
+
delimiter: "\t",
|
11
|
+
delimiter_pattern: nil,
|
12
|
+
label_delimiter: ":"
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
def common_options
|
17
|
+
[
|
18
|
+
:delimiter,
|
19
|
+
:label_delimiter
|
20
|
+
]
|
21
|
+
end
|
22
|
+
|
23
|
+
def advanced_options
|
24
|
+
[
|
25
|
+
:delimiter_pattern
|
26
|
+
]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
class ParserMultiline
|
4
|
+
include Fluentd::Setting::Plugin
|
5
|
+
|
6
|
+
register_plugin("parser", "multiline")
|
7
|
+
|
8
|
+
FORMAT_MAX_NUM = 20
|
9
|
+
|
10
|
+
(1..FORMAT_MAX_NUM).each do |n|
|
11
|
+
config_param("format#{n}", :string)
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.initial_params
|
15
|
+
{}
|
16
|
+
end
|
17
|
+
|
18
|
+
def common_options
|
19
|
+
[:format_firstline] +
|
20
|
+
(1..FORMAT_MAX_NUM).to_a.map{|n| "format#{n}".to_sym }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
class ParserRegexp
|
4
|
+
include Fluentd::Setting::Plugin
|
5
|
+
|
6
|
+
register_plugin("parser", "regexp")
|
7
|
+
|
8
|
+
def self.initial_params
|
9
|
+
{}
|
10
|
+
end
|
11
|
+
|
12
|
+
def common_options
|
13
|
+
[
|
14
|
+
:expression
|
15
|
+
]
|
16
|
+
end
|
17
|
+
|
18
|
+
def hidden_options
|
19
|
+
[
|
20
|
+
:ignorecase,
|
21
|
+
:multiline
|
22
|
+
]
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
class ParserSyslog
|
4
|
+
include Fluentd::Setting::Plugin
|
5
|
+
|
6
|
+
register_plugin("parser", "syslog")
|
7
|
+
# Overwrite type of time_format
|
8
|
+
config_param(:time_format, :string)
|
9
|
+
|
10
|
+
def self.initial_params
|
11
|
+
{}
|
12
|
+
end
|
13
|
+
|
14
|
+
def common_options
|
15
|
+
[
|
16
|
+
:time_format,
|
17
|
+
:with_priority,
|
18
|
+
]
|
19
|
+
end
|
20
|
+
|
21
|
+
def advanced_options
|
22
|
+
[
|
23
|
+
:message_format,
|
24
|
+
:rfc5424_time_format
|
25
|
+
]
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
class ParserTsv
|
4
|
+
include Fluentd::Setting::Plugin
|
5
|
+
|
6
|
+
register_plugin("parser", "tsv")
|
7
|
+
|
8
|
+
def self.initial_params
|
9
|
+
{}
|
10
|
+
end
|
11
|
+
|
12
|
+
def common_options
|
13
|
+
[
|
14
|
+
:keys, :delimiter
|
15
|
+
]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
class Section
|
4
|
+
class << self
|
5
|
+
def inherited(klass)
|
6
|
+
klass.instance_eval do
|
7
|
+
include ActiveModel::Model
|
8
|
+
include ActiveModel::Attributes
|
9
|
+
include Fluentd::Setting::Configurable
|
10
|
+
include Fluentd::Setting::SectionParser
|
11
|
+
include Fluentd::Setting::PluginParameter
|
12
|
+
|
13
|
+
class_attribute :_klass, :_block, :_blocks
|
14
|
+
class_attribute :section_name, :required, :multi, :alias
|
15
|
+
self._klass = klass
|
16
|
+
self._blocks = []
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def init
|
21
|
+
_klass.instance_eval(&_block)
|
22
|
+
_blocks.each do |b|
|
23
|
+
_klass.instance_eval(&b)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# Don't overwrite options
|
28
|
+
def merge(**options, &block)
|
29
|
+
_blocks << block
|
30
|
+
end
|
31
|
+
|
32
|
+
def section?
|
33
|
+
true
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
class StorageLocal
|
4
|
+
include Fluentd::Setting::Plugin
|
5
|
+
|
6
|
+
register_plugin("storage", "local")
|
7
|
+
|
8
|
+
def self.initial_params
|
9
|
+
{}
|
10
|
+
end
|
11
|
+
|
12
|
+
def common_options
|
13
|
+
[
|
14
|
+
:path,
|
15
|
+
:mode,
|
16
|
+
:dir_mode,
|
17
|
+
:pretty_print
|
18
|
+
]
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|