Sorry if this is a dumb question, we're using ES for lots of different things across our environment. I am the infrastructure guy and one of the things I am tasked with is monitoring functionality. What I would like to know is:
How do I query for the timestamp of the most recent entry for a specific type - for instance we're reading STOMP auditing messages from our message queue servers into a _type=mq-message. How do I query either for the most recent entries timestamp or just query for X in the last 5 min.
I am trying the following but I am failing...
curl -XGET http://localhost:9200/logstash-2015.05.14/_search
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"term": {
"_type": "mq-message"
}
},
"range": {
"timestamp": {
"gt": "now-1h"
}
}
}
}
}
It says "ElasticsearchParseException[Expected field name but got START_OBJECT "range"