The log collector e2e test was failing due to capturing two log collector runs:
2024-08-27T08:29:28.196982Z INFO CollectLogsHandler ExtHandler Starting log collection...
2024-08-27T08:29:39.595852Z INFO MainThread LogCollector [CGI] Using cgroup v1 for resource enforcement and monitoring
2024-08-27T08:29:39.597196Z INFO MainThread LogCollector [CGI] cpu,cpuacct controller for cgroup: azure-walinuxagent-logcollector [/sys/fs/cgroup/cpu,cpuacct/azure.slice/azure-walinuxagent.slice/azure-walinuxagent-logcollector.slice/collect-logs.scope]
2024-08-27T08:29:39.597349Z INFO MainThread LogCollector [CGI] memory controller for cgroup: azure-walinuxagent-logcollector [/sys/fs/cgroup/memory/azure.slice/azure-walinuxagent.slice/azure-walinuxagent-logcollector.slice/collect-logs.scope]
2024-08-27T08:29:40.893991Z INFO MainThread LogCollector Log collection successfully completed. Archive can be found at /var/lib/waagent/logcollector/logs.zip and detailed log output can be found at /var/lib/waagent/logcollector/results.txt
2024-08-27T08:29:42.497298Z INFO CollectLogsHandler ExtHandler Successfully collected logs. Archive size: 118167 b, elapsed time: 14300 ms.
2024-08-27T08:29:42.515656Z INFO CollectLogsHandler ExtHandler Successfully uploaded logs.
2024-08-27T08:38:24.831219Z INFO CollectLogsHandler ExtHandler Starting log collection...
2024-08-27T08:38:36.095471Z INFO MainThread LogCollector [CGI] Using cgroup v1 for resource enforcement and monitoring
2024-08-27T08:38:36.096962Z INFO MainThread LogCollector [CGI] cpu,cpuacct controller for cgroup: azure-walinuxagent-logcollector [/sys/fs/cgroup/cpu,cpuacct/azure.slice/azure-walinuxagent.slice/azure-walinuxagent-logcollector.slice/collect-logs.scope]
2024-08-27T08:38:36.097165Z INFO MainThread LogCollector [CGI] memory controller for cgroup: azure-walinuxagent-logcollector [/sys/fs/cgroup/memory/azure.slice/azure-walinuxagent.slice/azure-walinuxagent-logcollector.slice/collect-logs.scope]
2024-08-27T08:38:37.897544Z INFO MainThread LogCollector Log collection successfully completed. Archive can be found at /var/lib/waagent/logcollector/logs.zip and detailed log output can be found at /var/lib/waagent/logcollector/results.txt
2024-08-27T08:38:39.098655Z INFO CollectLogsHandler ExtHandler Successfully collected logs. Archive size: 268338 b, elapsed time: 14267 ms.
2024-08-27T08:38:39.119142Z INFO CollectLogsHandler ExtHandler Successfully uploaded logs.!
This PR updates the command to take the first matching pattern
Issue #
PR information
[ ] The title of the PR is clear and informative.
[ ] There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
[ ] If applicable, the PR references the bug/issue that it fixes in the description.
[ ] New Unit tests were added for the changes made
Description
The log collector e2e test was failing due to capturing two log collector runs:
This PR updates the command to take the first matching pattern
Issue #
PR information
Quality of Code and Contribution Guidelines