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.

Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog.md +5 -0
  3. data/Gemfile.lock +56 -1
  4. data/README.md +2 -2
  5. data/app/controllers/api/config_definitions_controller.rb +55 -0
  6. data/app/controllers/api_controller.rb +20 -3
  7. data/app/controllers/concerns/setting_concern.rb +18 -2
  8. data/app/controllers/fluentd/settings/in_tail_controller.rb +13 -5
  9. data/app/controllers/fluentd/settings/out_forward_controller.rb +0 -9
  10. data/app/controllers/fluentd/settings/out_s3_controller.rb +0 -5
  11. data/app/controllers/fluentd/settings/out_tdlog_controller.rb +9 -0
  12. data/app/form_builders/fluentd_form_builder.rb +83 -0
  13. data/app/helpers/settings_helper.rb +81 -18
  14. data/app/javascript/packs/application.js +4 -0
  15. data/app/javascript/packs/in_tail_parse.js +159 -0
  16. data/app/javascript/packs/owned_plugin_form.js +141 -0
  17. data/app/javascript/packs/parser_multiline_form.js +51 -0
  18. data/app/javascript/packs/plugin_setting.js +19 -0
  19. data/app/models/concerns/fluentd/setting/configurable.rb +113 -0
  20. data/app/models/concerns/fluentd/setting/pattern.rb +11 -0
  21. data/app/models/concerns/fluentd/setting/plugin.rb +78 -0
  22. data/app/models/concerns/fluentd/setting/plugin_config.rb +74 -0
  23. data/app/models/concerns/fluentd/setting/plugin_parameter.rb +121 -0
  24. data/app/models/concerns/fluentd/setting/section_parser.rb +36 -0
  25. data/app/models/concerns/fluentd/setting/section_validator.rb +21 -0
  26. data/app/models/fluentd.rb +5 -5
  27. data/app/models/fluentd/setting/buffer_file.rb +23 -0
  28. data/app/models/fluentd/setting/buffer_memory.rb +17 -0
  29. data/app/models/fluentd/setting/formatter_csv.rb +21 -0
  30. data/app/models/fluentd/setting/formatter_hash.rb +19 -0
  31. data/app/models/fluentd/setting/formatter_json.rb +25 -0
  32. data/app/models/fluentd/setting/formatter_ltsv.rb +21 -0
  33. data/app/models/fluentd/setting/formatter_msgpack.rb +13 -0
  34. data/app/models/fluentd/setting/formatter_out_file.rb +21 -0
  35. data/app/models/fluentd/setting/formatter_single_value.rb +20 -0
  36. data/app/models/fluentd/setting/formatter_stdout.rb +19 -0
  37. data/app/models/fluentd/setting/formatter_tsv.rb +21 -0
  38. data/app/models/fluentd/setting/in_forward.rb +7 -17
  39. data/app/models/fluentd/setting/in_http.rb +13 -19
  40. data/app/models/fluentd/setting/in_monitor_agent.rb +6 -19
  41. data/app/models/fluentd/setting/in_syslog.rb +14 -12
  42. data/app/models/fluentd/setting/in_tail.rb +7 -84
  43. data/app/models/fluentd/setting/out_elasticsearch.rb +12 -21
  44. data/app/models/fluentd/setting/out_forward.rb +22 -66
  45. data/app/models/fluentd/setting/out_mongo.rb +20 -26
  46. data/app/models/fluentd/setting/out_s3.rb +18 -30
  47. data/app/models/fluentd/setting/out_stdout.rb +21 -18
  48. data/app/models/fluentd/setting/out_tdlog.rb +35 -0
  49. data/app/models/fluentd/setting/parser_apache.rb +13 -0
  50. data/app/models/fluentd/setting/parser_apache2.rb +13 -0
  51. data/app/models/fluentd/setting/parser_apache_error.rb +13 -0
  52. data/app/models/fluentd/setting/parser_csv.rb +22 -0
  53. data/app/models/fluentd/setting/parser_in_http.rb +13 -0
  54. data/app/models/fluentd/setting/parser_json.rb +25 -0
  55. data/app/models/fluentd/setting/parser_ltsv.rb +30 -0
  56. data/app/models/fluentd/setting/parser_msgpack.rb +13 -0
  57. data/app/models/fluentd/setting/parser_multiline.rb +24 -0
  58. data/app/models/fluentd/setting/parser_nginx.rb +13 -0
  59. data/app/models/fluentd/setting/parser_none.rb +19 -0
  60. data/app/models/fluentd/setting/parser_regexp.rb +26 -0
  61. data/app/models/fluentd/setting/parser_syslog.rb +29 -0
  62. data/app/models/fluentd/setting/parser_tsv.rb +19 -0
  63. data/app/models/fluentd/setting/section.rb +38 -0
  64. data/app/models/fluentd/setting/storage_local.rb +22 -0
  65. data/app/models/fluentd/setting/type/array.rb +17 -0
  66. data/app/models/fluentd/setting/type/bool.rb +18 -0
  67. data/app/models/fluentd/setting/type/enum.rb +17 -0
  68. data/app/models/fluentd/setting/type/hash.rb +17 -0
  69. data/app/models/fluentd/setting/type/regexp.rb +17 -0
  70. data/app/models/fluentd/setting/type/section.rb +17 -0
  71. data/app/models/fluentd/setting/type/size.rb +17 -0
  72. data/app/models/fluentd/setting/type/time.rb +17 -0
  73. data/app/views/api/settings/_element.json.jbuilder +1 -1
  74. data/app/views/fluentd/settings/in_forward/_form.html.haml +16 -0
  75. data/app/views/fluentd/settings/in_tail/_form.html.haml +22 -29
  76. data/app/views/fluentd/settings/in_tail/after_file_choose.html.haml +1 -1
  77. data/app/views/fluentd/settings/in_tail/after_format.html.haml +4 -4
  78. data/app/views/fluentd/settings/in_tail/confirm.html.haml +5 -5
  79. data/app/views/fluentd/settings/source_and_output.html.haml +1 -1
  80. data/app/views/shared/_global_nav.html.erb +8 -8
  81. data/app/views/shared/settings/_form.html.haml +40 -9
  82. data/app/views/shared/settings/show.html.haml +4 -1
  83. data/app/views/shared/vue/_in_tail_parse.html.haml +20 -0
  84. data/app/views/shared/vue/_owned_plugin_form.html.haml +68 -0
  85. data/app/views/shared/vue/_parser_multiline_form.html.haml +19 -0
  86. data/app/views/shared/vue/_setting.html.erb +1 -1
  87. data/config/application.rb +1 -1
  88. data/config/environment.rb +3 -0
  89. data/config/initializers/types.rb +7 -0
  90. data/config/routes.rb +2 -1
  91. data/fluentd-ui.gemspec +5 -0
  92. data/lib/fluentd-ui/version.rb +1 -1
  93. data/lib/regexp_preview.rb +2 -2
  94. data/lib/regexp_preview/multi_line.rb +53 -63
  95. data/lib/regexp_preview/single_line.rb +40 -46
  96. data/spec/features/fluentd/setting/out_forward_spec.rb +1 -1
  97. data/spec/features/fluentd/setting/out_stdout_spec.rb +1 -1
  98. data/spec/features/{out_td_spec.rb → out_tdlog_spec.rb} +3 -3
  99. data/spec/lib/regexp_preview/multi_line_spec.rb +29 -34
  100. data/spec/lib/regexp_preview/single_line_spec.rb +89 -87
  101. data/spec/models/fluentd/setting/in_forward_spec.rb +75 -0
  102. data/spec/models/fluentd/setting/in_http_spec.rb +31 -0
  103. data/spec/models/fluentd/setting/in_monitor_agent_spec.rb +31 -0
  104. data/spec/models/fluentd/setting/in_syslog_spec.rb +65 -7
  105. data/spec/models/fluentd/setting/in_tail_spec.rb +47 -0
  106. data/spec/models/fluentd/setting/out_elasticsearch_spec.rb +31 -0
  107. data/spec/models/fluentd/setting/out_mongo_spec.rb +35 -12
  108. data/spec/models/fluentd/setting/out_s3_spec.rb +128 -0
  109. data/spec/models/fluentd/setting/out_stdout_spec.rb +31 -0
  110. data/spec/models/fluentd/setting/out_tdlog_spec.rb +47 -0
  111. metadata +164 -38
  112. data/app/controllers/fluentd/settings/out_td_controller.rb +0 -18
  113. data/app/helpers/fluentd/settings_helper.rb +0 -2
  114. data/app/javascript/packs/in_tail_format.js +0 -174
  115. data/app/models/fluentd/setting/common.rb +0 -185
  116. data/app/models/fluentd/setting/out_td.rb +0 -48
  117. data/app/views/shared/vue/_in_tail_format.html.erb +0 -43
  118. data/spec/models/fluentd/setting/common_spec.rb +0 -178
  119. 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 Common
4
+ include Fluentd::Setting::Plugin
5
5
 
6
- KEYS = [:match, :output_type].freeze
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
- match: "debug.**",
18
- output_type: "json",
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
- :match, :output_type
29
+ :pattern, :output_type
25
30
  ]
26
31
  end
27
32
 
28
- def advanced_options
29
- []
30
- end
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,13 @@
1
+ class Fluentd
2
+ module Setting
3
+ class ParserApache
4
+ include Fluentd::Setting::Plugin
5
+
6
+ register_plugin("parser", "apache")
7
+
8
+ def self.initial_params
9
+ {}
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class Fluentd
2
+ module Setting
3
+ class ParserApache2
4
+ include Fluentd::Setting::Plugin
5
+
6
+ register_plugin("parser", "apache2")
7
+
8
+ def self.initial_params
9
+ {}
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class Fluentd
2
+ module Setting
3
+ class ParserApacheError
4
+ include Fluentd::Setting::Plugin
5
+
6
+ register_plugin("parser", "apache_error")
7
+
8
+ def self.initial_params
9
+ {}
10
+ end
11
+ end
12
+ end
13
+ 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,13 @@
1
+ class Fluentd
2
+ module Setting
3
+ class ParserInHttp
4
+ include Fluentd::Setting::Plugin
5
+
6
+ register_plugin("parser", "in_http")
7
+
8
+ def self.initial_params
9
+ {}
10
+ end
11
+ end
12
+ end
13
+ 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,13 @@
1
+ class Fluentd
2
+ module Setting
3
+ class ParserMsgpack
4
+ include Fluentd::Setting::Plugin
5
+
6
+ register_plugin("parser", "msgpack")
7
+
8
+ def self.initial_params
9
+ {}
10
+ end
11
+ end
12
+ end
13
+ 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,13 @@
1
+ class Fluentd
2
+ module Setting
3
+ class ParserNginx
4
+ include Fluentd::Setting::Plugin
5
+
6
+ register_plugin("parser", "nginx")
7
+
8
+ def self.initial_params
9
+ {}
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,19 @@
1
+ class Fluentd
2
+ module Setting
3
+ class ParserNone
4
+ include Fluentd::Setting::Plugin
5
+
6
+ register_plugin("parser", "none")
7
+
8
+ def self.initial_params
9
+ {}
10
+ end
11
+
12
+ def common_options
13
+ [
14
+ :message_key
15
+ ]
16
+ end
17
+ end
18
+ end
19
+ 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