0

我试图简单地让最近的事件发生在 curl 上,而且我总是得到同样的结果。这是我正在使用的卷曲:

curl localhost:9200/packetbeat-2017.01.26/_search?pretty=true -d '
{
"query": {
    "match_all": {}
},
"size": 1,
"sort": [{
    "_timestamp": {
        "order": "desc"
    }
}]
}

我尝试按升序和降序排列,它总是返回相同的事件。我的意思是我得到的信息总是相同的,即使是 ID(即使所有其他信息都相同,它也应该不同)。

4

1 回答 1

1

Filebeat 将该@timestamp字段添加到它发送的事件中。所以尝试使用:

curl -XGET "http://localhost:9200/filebeat-*/_search?pretty" -d'
{
  "size": 1,
  "sort": [
    {
      "@timestamp": {
        "order": "desc"
      }
    }
  ]
}'
于 2017-01-27T21:11:09.293 回答