Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution] Remove non-errors and user errors from console lo…
…gs (#206973) ## Summary This PR will drastically reduce the number of console logs from the Detection Engine in the overview cluster. If your team is depending on the `INFO`, `WARNING`, or `verification_exception` or `ml job missing` `ERROR` logs in that cluster, please raise your concerns here. Addresses elastic/kibana-team#1395, elastic/kibana-team#1333 Historically Detection Rules have written an enormous amount of data to the console logs. This was helpful in debugging years ago before we had the event log, but now we generally don't use them much. The console logs all still get scooped up and sent to the overview cluster though. Every rule execution writes two or more status changes (first to 'running', then to the final status later on) and these go to the console, the event log, and the rule SO. The end result is 76% of all logs are coming from detection rules changing status, mostly successful statuses. These provide little value on their own. This PR restricts console logging from detection rules to only non-user errors. User errors and execution statuses below the error level will be logged in the console at the `debug` level. "Unexpected" errors like search exceptions, timeouts, etc will still appear as errors in the console logs. The general idea is that the logs from detection rules in the console should represent some kind of unexpected system failure. To implement this change, I updated the console logging logic in both the security rule execution logger. User errors reported to the framework will still create console error logs since they're logged at the framework level. ## Testing Create rules that run and generate warnings (e.g. missing index), user errors (EQL verification exceptions), and non-user errors. An easy way to create a non-user error at the moment is running a threshold rule when at least one index searched maps `@timestamp` as a `keyword` instead of `date`. The non user errors still show up in console logs as errors. User errors and warnings only show up as debug logs and with debug logging enabled in the Kibana config.
- Loading branch information