不要急,总有办法的

query的输出能否把_index、_type、_id、_score这几个字段去掉?

Kibana | 作者 sailershen | 发布于2019年07月19日 | 阅读数:2681

query语句:
GET /bj-sip_register/_search
{
"query": {
"range": {
"@timestamp": {
"gte": "now-4h",
"lte": "now"
}
}
},
"_source": ["ouyu-number","@timestamp"]
}
输出结果的_source部分只显示ouyu-number和@timestamp:
{
"took" : 108,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 10000,
"relation" : "gte"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : "bj-sip_register",
"_type" : "_doc",
"_id" : "Vjv6CWwBZw_p4NeuCBYm",
"_score" : 1.0,
"_source" : {
"@timestamp" : "2019-07-19T11:24:36.673Z",
"ouyu-number" : "444192"
}
},
{
......

以上结果中_index、_type、_id、_score这几个字段不是我关心的,也不是想放在结果中的,能不能在查询结果中去掉不显示?
 
 
 
已邀请:

juin - 大数据开发

赞同来自: sailershen

emmmmm
这个
换个角度
只关心 _source 里的不就可以了
这几个系统字段应该是不能取消的

hufuman

赞同来自: sailershen

url加上filter_path,可以控制返回内容

要回复问题请先登录注册