Skip to content

parser: adjust Nginx options #718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion parser/nginx/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ func NewParser(c conf.MapConf) (parser.Parser, error) {

func NewNginxAccParser(c conf.MapConf) (p *Parser, err error) {
name, _ := c.GetStringOr(parser.KeyParserName, "")

schema, _ := c.GetStringOr(parser.NginxSchema, "")
nginxRegexStr, _ := c.GetStringOr(parser.NginxFormatRegex, "")
labelList, _ := c.GetStringListOr(parser.KeyLabels, []string{})
Expand Down
17 changes: 8 additions & 9 deletions parser/rest_parser_models.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ var ModeKeyOptions = map[string][]Option{
KeyName: NginxConfPath,
ChooseOnly: false,
Default: "",
Required: true,
Required: false,
Placeholder: "/opt/nginx/conf/nginx.conf",
DefaultNoUse: true,
Description: "nginx配置路径(nginx_log_format_path)",
Expand All @@ -149,27 +149,26 @@ var ModeKeyOptions = map[string][]Option{
ChooseOnly: false,
Default: "main",
Placeholder: "main",
Required: true,
Required: false,
DefaultNoUse: true,
Description: "nginx日志格式名称(nginx_log_format_name)",
},
{
KeyName: NginxSchema,
KeyName: NginxFormatRegex,
ChooseOnly: false,
Default: "",
DefaultNoUse: false,
Description: "手动指定字段类型(nginx_schema)",
Advance: true,
ToolTip: `nginx日志都被解析为string,指定该格式可以设置为float、long、date三种类型。如 time_local date,bytes_sent long,request_time float`,
Description: "手动指定正则表达式解析(nginx_log_format_regex)",
ToolTip: "若根据配置文件自动生成的正则表达式无效,可通过此配置手动填写",
},
{
KeyName: NginxFormatRegex,
KeyName: NginxSchema,
ChooseOnly: false,
Default: "",
DefaultNoUse: false,
Description: "手动指定正则表达式解析(nginx_log_format_regex)",
Description: "手动指定字段类型(nginx_schema)",
Advance: true,
ToolTip: "若根据配置文件自动生成的正则表达式无效,可通过此配置手动填写",
ToolTip: `nginx日志都被解析为string,指定该格式可以设置为float、long、date三种类型。如 time_local date,bytes_sent long,request_time float`,
},
OptionParserName,
OptionLabels,
Expand Down