Good day to all,
I think I figured out what the problem I am facing is.
I put the indexer in TRACE log mode, by adding/editing in `/etc/wazuh-indexer/opensearch.yml`
```
logger.level: TRACE
```
Tailing carefully the log files I found the query that the dashboard passes to the indexer to get value suggestions. I then tried and using that through the Dev Tools to get some insight.
If I try and get suggestions for alerts containing 'johndoe' as value for the field '
data.postfix.to', the dashboard sends a request to the indexer, containing this kind of query:
```
GET _search
{
"size": 0,
"timeout": "1000ms",
"terminate_after": 100000,
"query": {
"match_all": {
"boost": 1
}
},
"aggregations": {
"suggestions": {
"terms": {
"field": "
data.postfix.to",
"size": 10,
"shard_size": 10,
"min_doc_count": 1,
"shard_min_doc_count": 0,
"show_term_doc_count_error": false,
"execution_hint": "map",
"order": [
{
"_count": "desc"
},
{
"_key": "asc"
}
],
"include": ".*johndoe.*"
}
}
}
}
```
Assuming `johndoe` is one of the records that cannot be returned, the default parameters yields an empty response.
Fiddling around with the parameters, I figured that changing either the `timeout` or the `terminate_after` keyword could improve the results. The timeout did not prove useful.
However changing the `terminate_after` value from 100,000 to 1,000,000 (10x) resulted in the query returning the value I was looking for.
Assuming that my understanding is correct, that `terminate_after` applies the query to the first 100,000 docs as a default, I would like to ask you if there is a way of editing and increasing the default value.
I know that that would result in waiting a tad longer to get suggestions, but it is a price I would pay to get correct suggestions in my filters, if there are no smart alternatives. I will continue to look through the config to find a way to edit that, but if any of you already knows how to do it (or knows that it is not possible) that would save me a bit of a headache.
Cheers,
Simone
P.S.: Since this problem arises (AFAIK) because of the high number of alerts, I am curious about how generally admins manage this is situation. I have something like a month of alerts in this cluster and that does not seem like a overwhelming amount of data (not for this purpose at least!).