log support more time format

This commit is contained in:
710leo 2020-04-12 15:50:21 +08:00
parent 6e17b9a2f1
commit 69702e5fd6
2 changed files with 6 additions and 6 deletions

View File

@ -239,16 +239,16 @@ func GetPatAndTimeFormat(tf string) (string, string) {
var pat, timeFormat string
switch tf {
case "dd/mmm/yyyy:HH:MM:SS":
pat = `([012][0-9]|3[01])/[JFMASOND][a-z]{2}/(2[0-9]{3}):([01][0-9]|2[0-4])(:[012345][0-9]){2}`
pat = `([012][0-9]|3[01])/[JFMASONDjfmasond][a-zA-Z]{2}/(2[0-9]{3}):([01][0-9]|2[0-4])(:[012345][0-9]){2}`
timeFormat = "02/Jan/2006:15:04:05"
case "dd/mmm/yyyy HH:MM:SS":
pat = `([012][0-9]|3[01])/[JFMASOND][a-z]{2}/(2[0-9]{3})\s([01][0-9]|2[0-4])(:[012345][0-9]){2}`
pat = `([012][0-9]|3[01])/[JFMASONDjfmasond][a-zA-Z]{2}/(2[0-9]{3})\s([01][0-9]|2[0-4])(:[012345][0-9]){2}`
timeFormat = "02/Jan/2006 15:04:05"
case "yyyy-mm-ddTHH:MM:SS":
pat = `(2[0-9]{3})-(0[1-9]|1[012])-([012][0-9]|3[01])T([01][0-9]|2[0-4])(:[012345][0-9]){2}`
timeFormat = "2006-01-02T15:04:05"
case "dd-mmm-yyyy HH:MM:SS":
pat = `([012][0-9]|3[01])-[JFMASOND][a-z]{2}-(2[0-9]{3})\s([01][0-9]|2[0-4])(:[012345][0-9]){2}`
pat = `([012][0-9]|3[01])-[JFMASONDjfmasond][a-zA-Z]{2}-(2[0-9]{3})\s([01][0-9]|2[0-4])(:[012345][0-9]){2}`
timeFormat = "02-Jan-2006 15:04:05"
case "yyyy-mm-dd HH:MM:SS":
pat = `(2[0-9]{3})-(0[1-9]|1[012])-([012][0-9]|3[01])\s([01][0-9]|2[0-4])(:[012345][0-9]){2}`
@ -260,7 +260,7 @@ func GetPatAndTimeFormat(tf string) (string, string) {
pat = `(2[0-9]{3})(0[1-9]|1[012])([012][0-9]|3[01])\s([01][0-9]|2[0-4])(:[012345][0-9]){2}`
timeFormat = "20060102 15:04:05"
case "mmm dd HH:MM:SS":
pat = `[JFMASOND][a-z]{2}\s+([1-9]|[1-2][0-9]|3[01])\s([01][0-9]|2[0-4])(:[012345][0-9]){2}`
pat = `[JFMASONDjfmasond][a-zA-Z]{2}\s+([1-9]|[1-2][0-9]|3[01])\s([01][0-9]|2[0-4])(:[012345][0-9]){2}`
timeFormat = "Jan 2 15:04:05"
case "mmdd HH:MM:SS":
pat = `(0[1-9]|1[012])([012][0-9]|3[01])\s([01][0-9]|2[0-4])(:[012345][0-9]){2}`

View File

@ -82,9 +82,9 @@ func Parse(conf string) error {
viper.SetDefault("backend", map[string]interface{}{
"enabled": true,
"batch": 200, //每次拉取文件的个数
"replicas": 500, //一致性has虚拟节点
"replicas": 500, //一致性hash虚拟节点
"workerNum": 32,
"maxConns": 32, //查询和推送数据的并发个数
"maxConns": 2000, //查询和推送数据的并发个数
"maxIdle": 32, //建立的连接池的最大空闲数
"connTimeout": 1000, //链接超时时间,单位毫秒
"callTimeout": 3000, //访问超时时间,单位毫秒