Hello team, I am currently facing an issue while trying to load DSL query result in the Kibana Discover tool.
The query was created with the help from this forum , which provided the correct result do a NOT IN case. However when trying to load the query in Kibana we are facing the following errors
unknown field [aggs]
unknown field [size]
This is the full details on the error from Kibana front end -
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "unknown query [aggs]",
"line": 1,
"col": 631
}
],
"type": "x_content_parse_exception",
"reason": "[1:631] [bool] failed to parse field [filter]",
"caused_by": {
"type": "parsing_exception",
"reason": "unknown query [aggs]",
"line": 1,
"col": 631,
"caused_by": {
"type": "named_object_not_found_exception",
"reason": "[1:631] unknown field [aggs]"
}
}
}
}
the query is the following:
{
"size": 0,
"aggs": {
"processing_ids": {
"terms": {
"field": "processing_id",
"size": 10000
},
"aggs": {
"status_processing": {
"terms": {
"field": "status_processing"
},
"aggs": {
"latest_record": {
"top_hits": {
"size": 1,
"sort": [
{
"start_processing": {
"order": "desc"
}
}
]
}
}
}
},
"processing_id_filter": {
"bucket_selector": {
"buckets_path": {
"docCount": "_count"
},
"script": "params.docCount == 1"
}
}
}
}
}
}
i could only find one reference that Kibana Visualization does not support aggregation, can you please confirm? otherwise is there any workaround?
NOTE: the query runs perfectly on dev tools all i want to be able to bring the results to my dashboard.
this is a data sample:
POST /processing_records/_bulk
{"index":{}}
{"processing_id":"1234","file_name":"file1.xls","start_processing":"06/07/2024","status_processing":"processing"}
{"index":{}}
{"processing_id":"1234","file_name":"file1.xls","start_processing":"06/07/2024","end_processing":"06/07/2024","status_processing":"processed"}
{"index":{}}
{"processing_id":"1235","file_name":"file2.xls","start_processing":"06/07/2024","status_processing":"processing"}
{"index":{}}
{"processing_id":"1235","file_name":"file2.xls","start_processing":"06/07/2024","end_processing":"06/07/2024","status_processing":"processed"}
{"index":{}}
{"processing_id":"1236","file_name":"file2.xls","start_processing":"06/07/2024","status_processing":"processing"}
{"index":{}}
{"processing_id":"1236","file_name":"file2.xls","start_processing":"06/07/2024","end_processing":"06/07/2024","status_processing":"processed"}
{"index":{}}
{"processing_id":"1237","file_name":"file4.xls","start_processing":"06/07/2024","status_processing":"processing"}
my visualization in Kibana should only bring the processing ID records where the status processing is PROCESSING but does not have a status processing recorded as PROCESSED. In summary, the idea is to present only the records that are in PROCESSING status