Hi,
I'm trying to query ES for a server name and It works great. But, when i put in a dummy server name that i know doesn't exist (to prove my query really is working by not finding anything) it still brings back results that match part of my string.
What I'm trying to achieve is to know when a server isn't isn't logging to ES with a once a day check of that days index.
Working example (server names changed):
curl -XGET "http://localhost:9200/logstash-index/_search" -d'
{
"query": {
"bool" : {
"must": {
"match": {
"syslog_hostname": "uk-server-name-1"
}
}
}
}
}' | python -m json.tool
Returns output only for the server.
Not working example:
curl -XGET "http://localhost:9200/logstash-index/_search" -d'
{
"query": {
"bool" : {
"must": {
"match": {
"syslog_hostname": "not-a-real-1"
}
}
}
}
}' | python -m json.tool
This query returns everything matching "-1" part. Can anyone help me to make this an explicit search?
Thanks
Dennis