فهرست منبع

正则没有抽取

fengweiqiang 6 سال پیش
والد
کامیت
605f61fa49
1فایلهای تغییر یافته به همراه5 افزوده شده و 4 حذف شده
  1. 5 4
      src/jy/extract/extract.go

+ 5 - 4
src/jy/extract/extract.go

@@ -660,7 +660,8 @@ func ExtRegCore(extfrom string, doc map[string]interface{}, j *ju.Job, in *RegLu
 			j.Result[in.Field] = append(j.Result[in.Field], field)
 		}
 		AddExtLog("extract", j.SourceMid, nil, kvMap, in, et.TaskInfo) //抽取日志
-	} else if !in.IsLua {
+	}
+	if !in.IsLua {
 		//全文正则
 		//text := qu.ObjToString(doc[extfrom])
 		//if in.Field != "" {
@@ -771,7 +772,7 @@ func extRegCoreToResult(extfrom, text string, tag *map[string]string, j *ju.Job,
 						"field":     v.Field,
 						"code":      v.Code,
 						"ruletext":  v.RuleText,
-						"extfrom":   extfrom,
+						"extfrom":   text,
 						"value":     val,
 						"type":      "regexp",
 						"matchtype": "regcontent",
@@ -808,7 +809,7 @@ func extRegCoreToResult(extfrom, text string, tag *map[string]string, j *ju.Job,
 								"field":     v.Field,
 								"code":      v.Code,
 								"ruletext":  regArr[0],
-								"extfrom":   extfrom,
+								"extfrom":   text,
 								"value":     value,
 								"type":      "regexp",
 								"matchtype": "regcontent",
@@ -844,7 +845,7 @@ func extRegCoreToResult(extfrom, text string, tag *map[string]string, j *ju.Job,
 				"field":     v.Field,
 				"code":      v.Code,
 				"ruletext":  v.RuleText,
-				"extfrom":   extfrom,
+				"extfrom":   text,
 				"value":     val,
 				"type":      "regexp",
 				"matchtype": "regcontent",