# 丢弃字段

## 简介

`processor_drop processor`插件可以丢弃日志字段。

## 配置参数

| 参数       | 类型        | 是否必选 | 说明               |
| -------- | --------- | ---- | ---------------- |
| Type     | String    | 是    | 插件类型。            |
| DropKeys | String\[] | 是    | 指定待丢弃的字段，支持配置多个。 |

## 样例

采集`/home/test-log/`路径下的`json.log`文件，并按照`Json`格式进行日志解析，然后对解析后的字段进行丢弃。

* 输入

```
echo '{"key1": 123456, "key2": "abcd"}' >> /home/test-log/json.log
```

* 采集配置

```
enable: true
inputs:
  - Type: file_log
    LogPath: /home/test-log/
    FilePattern: key_value.log
processors:
  - Type: processor_json
    SourceKey: content
    KeepSource: false
    ExpandDepth: 1
    ExpandConnector: ""
  - Type: processor_drop
    DropKeys: 
      - key1
flushers:
  - Type: flusher_sls
    Endpoint: cn-xxx.log.aliyuncs.com
    ProjectName: test_project
    LogstoreName: test_logstore
  - Type: flusher_stdout
    OnlyStdout: true
```

* 输出

```
{
    "__tag__:__path__": "/home/test-dir/test_log/json.log",
    "key2": "abcd",
    "__time__": "1657354602"
}
```
