标签:query exist log external car for app server map
● 系统环境说明
Linux环境:centos 7.2
腾讯云ES Service:7.5.1
Java:1.8.0_181
● 集群配置
32核64GB, 3个(主节点)
50GB 高性能云盘 x1
32核64GB, 12个(数据节点)
6000GB SSD云硬盘 x2
ES cross cluster search(CCS)跨5个集群,查询到了数据,但是只聚合出1条结果。
GET /cluster_five:imlog_k12-2020-11-05/_search
{
"size": 10,
"query": {
"bool": {
"filter": [{
"range": {
"log_timestamp": {
"gte": "1604567040000",
"lte": "1604567459000",
"format": "epoch_millis"
}
}
}, {
"query_string": {
"analyze_wildcard": true,
"query": "project:\"scon_helper_server\" AND env:\"prod\" AND message:*user_external*"
}
}]
}
},
"aggs": {
"message_group": {
"terms": {
"field": "message.keyword"
}
}
}
}
这个是由于各个集群的mapping不一致导致,确认一下各集群的mapping。使用exists query即可确认:
{
"query": {
"exists": {
"field": "message.keyword"
}
}
}
标签:query exist log external car for app server map
原文地址:https://www.cnblogs.com/daemonyue/p/14208313.html