Created
December 17, 2020 12:44
-
-
Save sharkyak/934100d229232864fd0d5d715a1acd38 to your computer and use it in GitHub Desktop.
elasticsearch count records with conditions and range
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET /filebeat-*/_search | |
{ | |
"query": { | |
"bool": { | |
"must": [ | |
{ | |
"term": { | |
"host.hostname": { | |
"value": "mail" | |
} | |
} | |
}, | |
{ | |
"match": { | |
"message": "[inputs.postfix] Error in plugin" | |
} | |
}, | |
{ | |
"range": { | |
"@timestamp": { | |
"gte": "2020-12-17T09:00:00.000Z", | |
"lte": "2020-12-17T10:00:00.000Z" | |
} | |
} | |
} | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment