如果过去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