我想在elasticsearch 5.1中获取指定的字段。例如,从表中选择x,y
示例文档
{
"_index": "logstash-2017.01.05",
"_type": "logs",
"_id": "AVltoGqz-zTtgAXZybOK",
"_version": 1,
"found": true,
"_source": {
"sourcePORT": "55645",
"EndTime": "2016-11-08T03:00:43.033",
"StartTime": "2016-11-08T03:00:43.033",
"message": "10.215.56.162,55645,161.202.1.13,443,base.ip.tcp,2016-11-08T03:00:43.033,2016-11-08T03:00:43.033,0,74,0.000000,0,0-0:",
"DestinationPORT": "443",
"tags": [],
"path": "C:/Users/akshay.patil/Desktop/DataDump01.csv",
"DestinationIP": "161.202.1.13",
"@timestamp": "2017-01-05T07:55:46.710Z",
"sourceIP": "10.215.56.162",
"received_at": "2017-01-05T07:55:46.710Z",
"@version": "1",
"host": "3299D11",
"ProtocolPath": "base.ip.tcp"
}
}发布于 2017-01-23 14:17:55
非常简单,您可以像这样使用source filtering:
curl localhost:9200/index/type/_search?_source=x,y发布于 2017-02-07 19:25:41
这将返回您要打印的特定字段
GET /_search {"query" : {"match_all": {}}, "docvalue_fields" : ["filed_name"]}
https://stackoverflow.com/questions/41800206
复制相似问题