|
@@ -555,28 +555,30 @@ func ExtRegBack(j *ju.Job, in *RegLuaInfo, t *TaskInfo) {
|
|
|
}
|
|
|
} else {
|
|
|
extinfo := map[string]interface{}{}
|
|
|
- if in.Field != "" && j.Result[in.Field] != nil {
|
|
|
- tmp := j.Result[in.Field]
|
|
|
- exts := []interface{}{}
|
|
|
- for k, v := range tmp {
|
|
|
- text := qu.ObjToString(v.Value)
|
|
|
- if text != "" {
|
|
|
- text = in.RegPreBac.Reg.ReplaceAllString(text, in.RegPreBac.Replace)
|
|
|
+ if in.Field != "" {
|
|
|
+ if j.Result[in.Field] != nil {
|
|
|
+ tmp := j.Result[in.Field]
|
|
|
+ exts := []interface{}{}
|
|
|
+ for k, v := range tmp {
|
|
|
+ text := qu.ObjToString(v.Value)
|
|
|
+ if text != "" {
|
|
|
+ text = in.RegPreBac.Reg.ReplaceAllString(text, in.RegPreBac.Replace)
|
|
|
+ }
|
|
|
+ j.Result[in.Field][k].Value = text
|
|
|
+ exts = append(exts, map[string]interface{}{
|
|
|
+ "field": v.Field,
|
|
|
+ "code": v.Code,
|
|
|
+ "ruletext": v.RuleText,
|
|
|
+ "type": v.Type,
|
|
|
+ "matchtype": v.MatchType,
|
|
|
+ "extfrom": v.ExtFrom,
|
|
|
+ "value": text,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ extinfo[in.Field] = exts
|
|
|
+ if len(extinfo) > 0 {
|
|
|
+ AddExtLog("clear", j.SourceMid, tmp, extinfo, in, t) //抽取日志
|
|
|
}
|
|
|
- j.Result[in.Field][k].Value = text
|
|
|
- exts = append(exts, map[string]interface{}{
|
|
|
- "field": v.Field,
|
|
|
- "code": v.Code,
|
|
|
- "ruletext": v.RuleText,
|
|
|
- "type": v.Type,
|
|
|
- "matchtype": v.MatchType,
|
|
|
- "extfrom": v.ExtFrom,
|
|
|
- "value": text,
|
|
|
- })
|
|
|
- }
|
|
|
- extinfo[in.Field] = exts
|
|
|
- if len(extinfo) > 0 {
|
|
|
- AddExtLog("clear", j.SourceMid, tmp, extinfo, in, t) //抽取日志
|
|
|
}
|
|
|
} else {
|
|
|
for key, tmp := range j.Result {
|