
# 场景一：过滤LTS日志
您可以使用**e_if** 函数与DROP参数、**e_if_else** 函数与DROP参数过滤日志，也可以使用**e_drop** 函数或**e_keep**函数过滤日志。
常用规则如下所示：
- e_keep(e_has(...))：满足条件时保留，不满足条件时丢弃。
- e_drop(e_has(...) )：满足条件时丢弃，不满足条件时保留。
- e_if_else(e_has("..."), KEEP, DROP)：满足条件时保留，不满足条件时丢弃。
- e_if(e_not_has("..."), DROP)：满足条件时丢弃，不满足条件时保留。
示例如下所示：
- 原始日志
  ```
  [{ //日志1
  "source":  "192.168.0.1",
  "client_ip":  "192.168.0.2",
  "receive_time":  1587214851,
  "topic": "app",
  "class": "test_case",
  "id":  7892,
  "content":  "this is a log test"
  },
  { //日志2
  "source":  "192.168.0.1",
  "class":  "produce_case",
  "id":  7890,
  "content":  "this is a log test"
  }]
  ```
  
- 加工规则：丢弃没有topic字段和receive_time字段的日志。
  ```
  e_if(e_not_has("topic"),e_drop())
  e_if(e_not_has("receive_time"),e_drop())
  ```
  
- 加工结果
  ```
  {
  source:  192.168.0.1
  client_ip:  192.168.0.2
  receive_time:  1587214851
  topic: app 
  class:  test_case
  id:  7892
  content:  this is a log test
  }
  ```
  
 
