我正在尝试创建一个 gsub 管道,但在此之前我尝试按照互联网上的许多示例来模拟它。这是我的代码:
PUT _ingest/pipeline/removescript/_simulate
{
"pipeline" :{
"description": "remove script",
"processors": [
{ "gsub" :{
"field": "content",
"pattern": "(?:..)[^<%]+[^%>](?:..)",
"replacement": ""
}
}]
},
"docs": [
{
"_id": "tt",
"_source": {
"content": "leave <% remove me %> Me"
}
}]
}
Run Code Online (Sandbox Code Playgroud)
但是,当我运行它时,我收到以下错误:
找不到 uri [/_ingest/pipeline/removescript/_simulate] 和方法 [PUT] 的处理程序
如果我将 PUT 行更改为:
PUT _ingest/pipeline/_simulate或PUT _ingest/pipeline/removescript
然后我收到以下错误:
{
"error": {
"root_cause": [
{
"type": "parse_exception",
"reason": "[processors] required property is missing",
"header": {
"property_name": "processors"
}
}
],
"type": "parse_exception",
"reason": "[processors] required property is missing",
"header": {
"property_name": "processors"
}
},
"status": 400
}
Run Code Online (Sandbox Code Playgroud)
端点仅适用于_simulate且不POST适用于PUT:
POST _ingest/pipeline/removescript/_simulate
{
...
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1595 次 |
| 最近记录: |