Sorry for that. Here are the codes:
Original Query:
GET <index_name>/_search
{
"from": 0,
"size": 5,
"query": {
"filtered": {
"query": {
"regexp": {
"message": ".*reprocess costing data count = [1-9][0-9]*.*"
}
},
"filter": {
"bool": {
"must": [
{
"range": {
"@timestamp": {
"gte": "now-15m"
}
}
}
],
"must_not": []
}
}
}
}
}
Error:
{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "no [query] registered for [filtered]",
"line": 5,
"col": 17
}
],
"type": "parsing_exception",
"reason": "no [query] registered for [filtered]",
"line": 5,
"col": 17
},
"status": 400
}
Then changed "filtered" with "bool"(query clause):
GET <index_name>/_search
{
"from": 0,
"size": 5,
"query": {
"bool": {
"query": {
"regexp": {
"message": ".*reprocess costing data count = [1-9][0-9]*.*"
}
},
"filter": {
"bool": {
"must": [
{
"range": {
"@timestamp": {
"gte": "now-15m"
}
}
}
],
"must_not": []
}
}
}
}
}
Error 2:
{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "[bool] query does not support [query]",
"line": 6,
"col": 16
}
],
"type": "parsing_exception",
"reason": "[bool] query does not support [query]",
"line": 6,
"col": 16
},
"status": 400
}
Removed "bool" & "query" under "query" clause:
GET <index_name>/_search
{
"from": 0,
"size": 5,
"query": {
"regexp": {
"message": ".*reprocess costing data count = [1-9][0-9]*.*"
}
},
"filter": {
"bool": {
"must": [
{
"range": {
"@timestamp": {
"gte": "now-15m"
}
}
}
],
"must_not": []
}
}
}
Error 3:
{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "Unknown key for a START_OBJECT in [filter].",
"line": 7,
"col": 13
}
],
"type": "parsing_exception",
"reason": "Unknown key for a START_OBJECT in [filter].",
"line": 7,
"col": 13
},
"status": 400
}