just for testing, I have a single elasticsearch node containing indexes like:
service-log-17032020 service-log-20032020 service-log-21032020
I am trying to build a query for searching on all indexes with service-log-* pattern. This query works perfectly with the full index name, how can I search on all indexes?
index = INDEX_NAME
query_body = {
"from":0,
"size":100,
"query": {
"bool": {
"must": [
{
"match" : {
"field": "text"
}
},
{
"range": {
"@timestamp": {
"gt":str(date)
}
}
}
]
}
}
}
result = elastic_client.search(index=INDEX_NAME, body=query_body)