mirror of
https://github.com/fluent/fluentd-ui.git
synced 2026-05-05 19:06:12 +02:00
Use constant for magic number
This commit is contained in:
parent
c591734ede
commit
f4381a81fd
@ -1,6 +1,8 @@
|
||||
class Fluentd
|
||||
module Setting
|
||||
class InTail
|
||||
MULTI_LINE_MAX_FORMAT_COUNT = 20
|
||||
|
||||
include ActiveModel::Model
|
||||
attr_accessor :path, :tag, :format, :regexp, :time_format, :rotate_wait, :pos_file, :read_from_head, :refresh_interval
|
||||
|
||||
@ -18,7 +20,7 @@ class Fluentd
|
||||
:ltsv => [:delimiter, :time_key],
|
||||
:json => [:time_key],
|
||||
:regexp => [:time_format, :regexp],
|
||||
:multiline => [:format_firstline] + (1..20).map{|n| "format#{n}".to_sym }
|
||||
:multiline => [:format_firstline] + (1..MULTI_LINE_MAX_FORMAT_COUNT).map{|n| "format#{n}".to_sym }
|
||||
# TODO: Grok could generate Regexp including \d, \s, etc. fluentd config parser raise error with them for escape sequence check.
|
||||
# TBD How to handle Grok/Regexp later, just comment out for hide
|
||||
# :grok => [:grok_str],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user