如果過去10分鐘內發生錯誤,我正在使用ElastAlert通知我的消費者。我想發送發生的錯誤列表。但是,在列表中的項目被分成兩個,如果有連字符(「 - 」)出現在的errorCodeElastAlert拆分字段
這是結果,我想
errorCode:
error1: 10
error-place-2: 15
error-new-place-3: 20
這是結果我得到
erorrCode:
error1: 10
error: 35
place: 35
2: 15
new: 20
3: 20
有沒有獲得理想結果的方法?
更新 - 索引映射的結果添加
{
"indexdate":{
"mappings":{
"app_log":{
"properties":{
},
"transaction_log":{
"properties":{
"@timestamp":{
"type":"date",
"format":"strict_date_optional_time||epoch_millis"
},
"other":{
},
"errorCode":{
"type":"string"
},
"other":{
},
}
}
}
}
}
你需要確保你的'errorCode'場'not_analyzed'as它似乎並沒有這樣的情況,因此,爲什麼你的錯誤代碼被分割。 – Val
我需要將'errorCode'字段設置爲'not_analyzed'嗎? – warrior107
在你的映射中。它現在如何?運行'curl -XGET localhost:9200/your-index /'並將'your-index'替換爲真正的索引名稱。用你得到的結果更新你的問題。 – Val