
# 场景二：使用e_set函数为日志空缺字段赋值
您可以使用**e_set**函数为日志空缺字段赋值。
1. **子场景1：原字段不存在或者为空时，为字段赋值。**
   ```
   e_set("result", "......value......", mode="fill")
   ```
   示例如下所示：
   - 原始日志
     ```
     {
         "name":""
     }
     ```
     
   
   - 加工规则
     ```
     e_set("name", "Apache 2.0", mode="fill")
     ```
     
   
   - 加工结果
     ```
     {
     name:Apache 2.0
     }
     ```
     
    
2. **子场景2：为多个字段赋值。**
   ```
   e_set("k1", "v1", "k2", "v2")
   ```
   示例如下所示：
   - 原始日志
     ```
     {"source":"192.168.0.1",
     "topic":"",
     "tag":"",
     "id":7990,
     "content":"this is a log"
     }
     ```
     
   
   - 加工规则
     ```
     e_set("topic","app","tag","stu")
     ```
     
   
   - 加工结果
     ```
     {topic: app
     source: 192.168.0.1
     tag: stu
     id: 7990
     content: this is a log
     }
     ```
     
    
 
