Skip to content

Instantly share code, notes, and snippets.

@sharkyak
Created December 17, 2020 12:44
Show Gist options
  • Save sharkyak/934100d229232864fd0d5d715a1acd38 to your computer and use it in GitHub Desktop.
Save sharkyak/934100d229232864fd0d5d715a1acd38 to your computer and use it in GitHub Desktop.
elasticsearch count records with conditions and range
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