即使是不成熟的尝试,也胜于胎死腹中的策略。

es5.5之前的版本 Remove Processor移除多个字段如何设置?

Elasticsearch | 作者 Aruen | 发布于2019年01月16日 | 阅读数:1643

PUT _ingest/pipeline/timestamp-pipeline-id
{
  "processors" : [
    {
      "remove" : {
        "field": ["@timestamp","type"]
      }
    }
  ]
}
 
报错:
{
  "error": {
    "root_cause": [
      {
        "type": "parse_exception",
        "reason": "[field] property isn't a string, but of type [java.util.ArrayList]",
        "header": {
          "processor_type": "remove",
          "property_name": "field"
        }
      }
    ],
    "type": "parse_exception",
    "reason": "[field] property isn't a string, but of type [java.util.ArrayList]",
    "header": {
      "processor_type": "remove",
      "property_name": "field"
    }
  },
  "status": 400
}
111.png
已邀请:

rochy - rochy_he

赞同来自:

这个就是说,你里面的字段只能设置一个,不能是一个数组;
你改成这样:
PUT _ingest/pipeline/timestamp-pipeline-id
{
"processors" : [
{
"remove" : {
"field": "@timestamp"
}
},
{
"remove" : {
"field": "type"
}
}
]
}

Aruen - 算法工程师

赞同来自:

这样就可以了,谢谢!!!{
  "timestamp-pipeline-id1": {
    "processors": [
      {
        "remove": {
          "field": "@timestamp"
        }
      },
      {
        "remove": {
          "field": "type"
        }
      }
    ]
  }
}

要回复问题请先登录注册