mirror of
https://github.com/fluent/fluentd-ui.git
synced 2026-05-07 20:06:10 +02:00
Fix a bug that error is raised when multi-line format
This commit is contained in:
parent
79f0b1fe28
commit
098b74de4b
@ -21,11 +21,14 @@ class ApiController < ApplicationController
|
||||
def regexp_preview
|
||||
preview = RegexpPreview.processor(params[:format]).new(params[:file], params[:format], params)
|
||||
matches = preview.matches
|
||||
|
||||
render json: {
|
||||
params: {
|
||||
setting: {
|
||||
regexp: preview.regexp.try(:source),
|
||||
time_format: preview.time_format,
|
||||
# NOTE: regexp and timeformat are used when format == 'apache' || 'nginx' || etc.
|
||||
# TODO: prepare rendered JSON by prcessor(RegexpPreview::{Signle,Multi}Line
|
||||
regexp: preview.try(:regexp).try(:source),
|
||||
time_format: preview.try(:time_format),
|
||||
}
|
||||
},
|
||||
matches: matches.compact,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user