-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Server Security
-
Fully Compatible
-
Security 2024-08-19
The findMatchingLogLines function is returning an iterator that yields each matched log line in the array one by one (code). This allows us to process each matched log line as it is ready, rather than return entire matched logs. But, some jstest codes (here) use its return as an array. It's not correct.
The correct usage is that using for-of loop to iterate the matched log lines one by one or using `[...findMatchingLogLines(logs, fields)]` to return all matched log lines.
In this ticket, we will fix the call site codes which do not use this function correctly. Also, we will refactor this function by adding code comment and renaming it to prevent misuse and improve clarity.