|
@@ -754,6 +754,7 @@ func getKvByLuaFields(vc *RuleCore, j *ju.Job, et *ExtractTask) map[string][]map
|
|
|
text := ju.TrimLRSpace(vv.Value, "")
|
|
|
if text != "" {
|
|
|
kvmap[field] = append(kvmap[field], map[string]interface{}{
|
|
|
+ "code": "CL_" + vv.Key,
|
|
|
"field": field,
|
|
|
"ruletext": vv.Key,
|
|
|
"extfrom": vc.ExtFrom,
|
|
@@ -934,10 +935,10 @@ func ExtRegBack(j *ju.Job, in *RegLuaInfo, t *TaskInfo) {
|
|
|
if text != "" {
|
|
|
text = in.RegPreBac.Reg.ReplaceAllString(text, in.RegPreBac.Replace)
|
|
|
}
|
|
|
- j.Result[in.Field][k].Value = text
|
|
|
if text == qu.ObjToString(v.Value) { //值未发生改变,不存日志
|
|
|
continue
|
|
|
}
|
|
|
+ j.Result[in.Field][k].Value = text
|
|
|
exts = append(exts, map[string]interface{}{
|
|
|
"field": v.Field,
|
|
|
"code": v.Code,
|
|
@@ -964,10 +965,10 @@ func ExtRegBack(j *ju.Job, in *RegLuaInfo, t *TaskInfo) {
|
|
|
if text != "" {
|
|
|
text = in.RegPreBac.Reg.ReplaceAllString(text, in.RegPreBac.Replace)
|
|
|
}
|
|
|
- j.Result[key][k].Value = text
|
|
|
if text == qu.ObjToString(v.Value) { //值未发生改变,不存日志
|
|
|
continue
|
|
|
}
|
|
|
+ j.Result[key][k].Value = text
|
|
|
exts = append(exts, map[string]interface{}{
|
|
|
"field": v.Field,
|
|
|
"code": v.Code,
|
|
@@ -1018,7 +1019,7 @@ func AddExtLog(ftype, sid string, before interface{}, extinfo interface{}, v *Re
|
|
|
return
|
|
|
}
|
|
|
logdata := map[string]interface{}{
|
|
|
- "code": v.Code,
|
|
|
+ "code": qu.If(v.Code == "", "kv", v.Code),
|
|
|
"name": v.Name,
|
|
|
"type": ftype,
|
|
|
"ruletext": v.RuleText,
|
|
@@ -1118,10 +1119,13 @@ func AnalysisSaveResult(j, jf *ju.Job, e *ExtractTask) {
|
|
|
tmp := map[string]interface{}{} //抽取值
|
|
|
tmp["fieldall"] = auxinfo
|
|
|
for _, val := range result {
|
|
|
- for _, v := range val { //取第一个非负数
|
|
|
+ for _, v := range val { //取第一个非负数,项目名称除外
|
|
|
if v.Score > -1 {
|
|
|
tmp[v.Field] = v.Value
|
|
|
break
|
|
|
+ } else if v.Field == "projectname" {
|
|
|
+ tmp[v.Field] = v.Value
|
|
|
+ break
|
|
|
}
|
|
|
}
|
|
|
}
|