Ingest pipelines
node为ingest角色,对indexing request做预处理,主要用于数据转换为合规、期望值的场景
官方地址:
https://www.elastic.co/guide/en/elasticsearch/reference/7.13/ingest.html#ingest
使用pipeline必要条件
node角色必须为:ingest
pipeline的组成
{
"description" : "...",
"processors" : [ ... ]
}
description:描述
processor: pipeline中的每个处理单元,pipeline的能力都由processor来提供
pipeline: es对indexing的doc做一些预处理的程序,pipeline可定义了很多个processor单元
pipeline的使用
1.创建pipeline
PUT _ingest/pipeline/my-pipeline
{
"description": "My optional pipeline description",
"processors": [
{
"set": {
"description": "My optional processor description",
"field": "my-long-field",
"value": 10
}
},
{
"lowercase": {
"field": "my-keyword-field"
}
}
]
}
2.测试pipeline
对_source进行小写
POST _ingest/pipeline