지난 10 분 동안 오류가 발생하면 ElastAlert를 사용하여 고객에게 알립니다. 발생한 오류 목록을 보내려고합니다. errorCode를ElastAlert가 필드를 분할합니다.
에 존재하는이 내가
erorrCode:
error1: 10
error: 35
place: 35
2: 15
new: 20
3: 20
을 얻고있다 결과 내가
errorCode:
error1: 10
error-place-2: 15
error-new-place-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":{
},
}
}
}
}
}
대신 ElastAlert의 설정에
errorCode.raw
를 사용해야합니다 오류 코드가 분리됩니다. – Val어디에서'errorCode' 필드를'not_analyzed'로 설정할 필요가 있습니까? – warrior107
지도 작성 중. 지금은 어떻게 생겼습니까? 이'curl -XGET localhost : 9200/your-index /'를 실행하고'your-index'를 실제 인덱스 이름으로 대체하십시오. 얻은 결과로 질문을 업데이트하십시오. – Val