[英]elasticsearch kibana update document which has space using update by query
我有一個要更新的字段,其中有空間。
POST /index/type/_update_by_query
{
"query": {
"match_phrase":{
"field": "value"
}
},
"script":{
"lang": "painless",
"inline": "ctx._source.Existing Field = New_Value"
}
}
但是我得到這個錯誤。
{
"error": {
"root_cause": [
{
"type": "script_exception",
"reason": "compile error",
"script_stack": [
"ctx._source.Existing Field = New_Value",
" ^---- HERE"
],
"script": "ctx._source.Existing Field = New_Value",
"lang": "painless"
}
],
"type": "script_exception",
"reason": "compile error",
"script_stack": [
"ctx._source.Existing Field = New_Value",
" ^---- HERE"
],
"script": "ctx._source.Existing Field = New_Value",
"lang": "painless",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "unexpected token ['Field'] was expecting one of [{<EOF>, ';'}]."
}
},
"status": 500
}
當我在沒有空間的字段上執行此查詢時,它可以正常工作。 如何處理字段名稱中有空格的情況?
ELK版本= 5.4.3我已經閱讀了文檔,不建議在字段名稱中使用空格,但是這些字段是從某個服務器動態創建的,每天大約有1M數據條目。 因此,我想對所有匹配的條目執行update_by_query。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.