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
@@ -0,0 +1,21 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
module SectionValidator
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
included do
|
7
|
+
validate :validate_sections
|
8
|
+
end
|
9
|
+
|
10
|
+
def validate_sections
|
11
|
+
self._section_params.each do |name, sections|
|
12
|
+
sections.each do |section|
|
13
|
+
if section.invalid?
|
14
|
+
errors.add(name, :invalid, message: section.errors.full_messages)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/app/models/fluentd.rb
CHANGED
@@ -14,28 +14,28 @@ class Fluentd
|
|
14
14
|
DEFAULT_CONF = <<-CONF.strip_heredoc
|
15
15
|
<source>
|
16
16
|
# http://docs.fluentd.org/articles/in_forward
|
17
|
-
type forward
|
17
|
+
@type forward
|
18
18
|
port 24224
|
19
19
|
</source>
|
20
20
|
|
21
21
|
<source>
|
22
22
|
# http://docs.fluentd.org/articles/in_http
|
23
|
-
type http
|
23
|
+
@type http
|
24
24
|
port 9880
|
25
25
|
</source>
|
26
26
|
|
27
27
|
<source>
|
28
|
-
type monitor_agent
|
28
|
+
@type monitor_agent
|
29
29
|
port 24220
|
30
30
|
</source>
|
31
31
|
<source>
|
32
|
-
type debug_agent
|
32
|
+
@type debug_agent
|
33
33
|
port 24230
|
34
34
|
</source>
|
35
35
|
|
36
36
|
<match debug.*>
|
37
37
|
# http://docs.fluentd.org/articles/out_stdout
|
38
|
-
type stdout
|
38
|
+
@type stdout
|
39
39
|
</match>
|
40
40
|
CONF
|
41
41
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
class BufferFile
|
4
|
+
include Fluentd::Setting::Plugin
|
5
|
+
|
6
|
+
register_plugin("buffer", "file")
|
7
|
+
|
8
|
+
def self.initial_params
|
9
|
+
{
|
10
|
+
path: ""
|
11
|
+
}
|
12
|
+
end
|
13
|
+
|
14
|
+
def common_options
|
15
|
+
[
|
16
|
+
:path,
|
17
|
+
:file_permission,
|
18
|
+
:dir_permission
|
19
|
+
]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
class FormatterCsv
|
4
|
+
include Fluentd::Setting::Plugin
|
5
|
+
|
6
|
+
register_plugin("formatter", "csv")
|
7
|
+
|
8
|
+
def self.initial_params
|
9
|
+
{}
|
10
|
+
end
|
11
|
+
|
12
|
+
def common_options
|
13
|
+
[
|
14
|
+
:delimiter,
|
15
|
+
:fields,
|
16
|
+
:add_newline
|
17
|
+
]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
class FormatterHash
|
4
|
+
include Fluentd::Setting::Plugin
|
5
|
+
|
6
|
+
register_plugin("formatter", "hash")
|
7
|
+
|
8
|
+
def self.initial_params
|
9
|
+
{}
|
10
|
+
end
|
11
|
+
|
12
|
+
def common_options
|
13
|
+
[
|
14
|
+
:add_newline
|
15
|
+
]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
class FormatterJson
|
4
|
+
include Fluentd::Setting::Plugin
|
5
|
+
|
6
|
+
register_plugin("formatter", "json")
|
7
|
+
|
8
|
+
def self.initial_params
|
9
|
+
{}
|
10
|
+
end
|
11
|
+
|
12
|
+
def common_options
|
13
|
+
[
|
14
|
+
:add_newline
|
15
|
+
]
|
16
|
+
end
|
17
|
+
|
18
|
+
def advanced_options
|
19
|
+
[
|
20
|
+
:json_parser
|
21
|
+
]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
class FormatterLtsv
|
4
|
+
include Fluentd::Setting::Plugin
|
5
|
+
|
6
|
+
register_plugin("formatter", "ltsv")
|
7
|
+
|
8
|
+
def self.initial_params
|
9
|
+
{}
|
10
|
+
end
|
11
|
+
|
12
|
+
def common_options
|
13
|
+
[
|
14
|
+
:delimiter,
|
15
|
+
:label_delimiter,
|
16
|
+
:add_newline
|
17
|
+
]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
class FormatterOutFile
|
4
|
+
include Fluentd::Setting::Plugin
|
5
|
+
|
6
|
+
register_plugin("formatter", "out_file")
|
7
|
+
|
8
|
+
def self.initial_params
|
9
|
+
{}
|
10
|
+
end
|
11
|
+
|
12
|
+
def common_options
|
13
|
+
[
|
14
|
+
:output_time,
|
15
|
+
:output_tag,
|
16
|
+
:delimiter
|
17
|
+
]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
class FormatterSingleValue
|
4
|
+
include Fluentd::Setting::Plugin
|
5
|
+
|
6
|
+
register_plugin("formatter", "single_value")
|
7
|
+
|
8
|
+
def self.initial_params
|
9
|
+
{}
|
10
|
+
end
|
11
|
+
|
12
|
+
def common_options
|
13
|
+
[
|
14
|
+
:message_key,
|
15
|
+
:add_newline
|
16
|
+
]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
class FormatterStdout
|
4
|
+
include Fluentd::Setting::Plugin
|
5
|
+
|
6
|
+
register_plugin("formatter", "stdout")
|
7
|
+
|
8
|
+
def self.initial_params
|
9
|
+
{}
|
10
|
+
end
|
11
|
+
|
12
|
+
def common_options
|
13
|
+
[
|
14
|
+
:output_type
|
15
|
+
]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
class FormatterTsv
|
4
|
+
include Fluentd::Setting::Plugin
|
5
|
+
|
6
|
+
register_plugin("formatter", "tsv")
|
7
|
+
|
8
|
+
def self.initial_params
|
9
|
+
{}
|
10
|
+
end
|
11
|
+
|
12
|
+
def common_options
|
13
|
+
[
|
14
|
+
:keys,
|
15
|
+
:delimiter,
|
16
|
+
:add_newline
|
17
|
+
]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -1,17 +1,9 @@
|
|
1
1
|
class Fluentd
|
2
2
|
module Setting
|
3
3
|
class InForward
|
4
|
-
include
|
5
|
-
include Common
|
4
|
+
include Fluentd::Setting::Plugin
|
6
5
|
|
7
|
-
|
8
|
-
:bind, :port, :linger_timeout, :chunk_size_limit, :chunk_size_warn_limit, :log_level
|
9
|
-
].freeze
|
10
|
-
|
11
|
-
attr_accessor(*KEYS)
|
12
|
-
|
13
|
-
validates :bind, presence: true
|
14
|
-
validates :port, presence: true
|
6
|
+
register_plugin("input", "forward")
|
15
7
|
|
16
8
|
def self.initial_params
|
17
9
|
{
|
@@ -20,7 +12,6 @@ class Fluentd
|
|
20
12
|
linger_timeout: 0,
|
21
13
|
chunk_size_limit: nil,
|
22
14
|
chunk_size_warn_limit: nil,
|
23
|
-
log_level: "info",
|
24
15
|
}
|
25
16
|
end
|
26
17
|
|
@@ -30,15 +21,14 @@ class Fluentd
|
|
30
21
|
]
|
31
22
|
end
|
32
23
|
|
33
|
-
def
|
24
|
+
def hidden_options
|
34
25
|
[
|
35
|
-
|
26
|
+
# We don't support TLS configuration via fluentd-ui for now.
|
27
|
+
:transport,
|
28
|
+
:backlog,
|
29
|
+
:blocking_timeout,
|
36
30
|
]
|
37
31
|
end
|
38
|
-
|
39
|
-
def plugin_name
|
40
|
-
"forward"
|
41
|
-
end
|
42
32
|
end
|
43
33
|
end
|
44
34
|
end
|
@@ -1,17 +1,9 @@
|
|
1
1
|
class Fluentd
|
2
2
|
module Setting
|
3
3
|
class InHttp
|
4
|
-
include
|
5
|
-
include Common
|
4
|
+
include Fluentd::Setting::Plugin
|
6
5
|
|
7
|
-
|
8
|
-
:bind, :port, :body_size_limit, :keepalive_timeout, :add_http_headers, :format, :log_level
|
9
|
-
].freeze
|
10
|
-
|
11
|
-
attr_accessor(*KEYS)
|
12
|
-
|
13
|
-
validates :bind, presence: true
|
14
|
-
validates :port, presence: true
|
6
|
+
register_plugin("input", "http")
|
15
7
|
|
16
8
|
def self.initial_params
|
17
9
|
{
|
@@ -20,26 +12,28 @@ class Fluentd
|
|
20
12
|
body_size_limit: "32m",
|
21
13
|
keepalive_timeout: "10s",
|
22
14
|
add_http_headers: false,
|
23
|
-
|
24
|
-
|
15
|
+
parse_type: "in_http",
|
16
|
+
parse: {
|
17
|
+
"0" => {
|
18
|
+
"type" => "in_http"
|
19
|
+
}
|
20
|
+
}
|
25
21
|
}
|
26
22
|
end
|
27
23
|
|
28
24
|
def common_options
|
29
25
|
[
|
30
|
-
:bind, :port
|
26
|
+
:bind, :port, :add_http_headers, :add_remote_addr
|
31
27
|
]
|
32
28
|
end
|
33
29
|
|
34
|
-
def
|
30
|
+
def hidden_options
|
35
31
|
[
|
36
|
-
:
|
32
|
+
:parse,
|
33
|
+
:backlog,
|
34
|
+
:blocking_timeout,
|
37
35
|
]
|
38
36
|
end
|
39
|
-
|
40
|
-
def plugin_name
|
41
|
-
"http"
|
42
|
-
end
|
43
37
|
end
|
44
38
|
end
|
45
39
|
end
|
@@ -1,38 +1,25 @@
|
|
1
1
|
class Fluentd
|
2
2
|
module Setting
|
3
3
|
class InMonitorAgent
|
4
|
-
include
|
5
|
-
include Common
|
4
|
+
include Fluentd::Setting::Plugin
|
6
5
|
|
7
|
-
|
8
|
-
:bind, :port
|
9
|
-
].freeze
|
10
|
-
|
11
|
-
attr_accessor(*KEYS)
|
12
|
-
|
13
|
-
validates :bind, presence: true
|
14
|
-
validates :port, presence: true
|
6
|
+
register_plugin("input", "monitor_agent")
|
15
7
|
|
16
8
|
def self.initial_params
|
17
9
|
{
|
18
10
|
bind: "0.0.0.0",
|
19
11
|
port: 24220,
|
12
|
+
emit_interval: 60,
|
13
|
+
include_config: true,
|
14
|
+
include_retry: true
|
20
15
|
}
|
21
16
|
end
|
22
17
|
|
23
18
|
def common_options
|
24
19
|
[
|
25
|
-
:bind, :port
|
20
|
+
:bind, :port, :tag
|
26
21
|
]
|
27
22
|
end
|
28
|
-
|
29
|
-
def advanced_options
|
30
|
-
[]
|
31
|
-
end
|
32
|
-
|
33
|
-
def plugin_name
|
34
|
-
"monitor_agent"
|
35
|
-
end
|
36
23
|
end
|
37
24
|
end
|
38
25
|
end
|