The Flow Log Collector plugin is used to collect CloudBees CD/RO and user-defined logs from CloudBees CD/RO servers and agents. The plugin can be used in both CloudBees CD/RO standalone servers, as well as clusters.
Plugin version 2.0.0.2023101908
Revised on October 19, 2023
Prerequisites
-
This plugin is using an updated version of Perl with the cb-perl shell, and requires CloudBees CD/RO agent version 10.3+ in order to work.
-
This plugin uses the STOMP server for sending and receiving files. Please ensure that the STOMP port (61613, by default) on the CloudBees CD/RO server where the plugin is installed and executed, is accessible from the CloudBees CD/RO resources from which logs are collected.
To check STOMP server URI, run the following command:
ectool getServerInfo
The output should look similar to the following:
<response requestId="1" nodeId="10.200.1.167"> <serverInfo> <cluster>0</cluster> <httpPort>8000</httpPort> <httpsPort>8443</httpsPort> <jobEventsDestination>/topic/events.job</jobEventsDestination> <jobEventsSelector>path = '/jobs/$[jobId]'</jobEventsSelector> <putFileDestination>/queue/jobs.$[jobId]</putFileDestination> <putFileSelector>command='PUT_FILE' AND channel='$[channel]'</putFileSelector> <stompClientUri>stomp+ssl://my.server:61613</stompClientUri> </serverInfo> </response>
To check connectivity, run the following command from the resource:
telnet my.server 61613
If the telnet command is successful, the STOMP server is accessible.
The STOMP URI can be configured under server properties:
-
Navigate to
. -
Locate the Stomp Client URI setting.
-
Set it to
stomp+ssl://<accessible hostname>:<STOMP Port>
The STOMP server port is configured in
commander.properties
, under a property namedCOMMANDER_STOMP_PORT
.
-
|
Limitations
-
The plugin uses command line execution to retrieve logs from each CloudBees CD/RO resource. In a cluster topology where nodes only have remote agents, CloudBees CD/RO server logs cannot be collected. In other words, any node from which the server logs needs to be collected should have a functioning local agent resource.
-
The ability to collect CloudBees CD/RO server logs based on filtering by Job Info is not implemented for Windows.
Plugin procedures
Collect Logs
Collect Logs parameters
Parameter | Description |
---|---|
Log collector resource |
CloudBees CD/RO resource that performs the work of log collection. A .zip archive containing the collected logs is created in this resource. |
Log target resources |
Comma-separated list of CloudBees CD/RO resources or resource pools from which the logs need to be collected. |
Collect CloudBees CD/RO server logs |
Collect the commander.log and commander-service.log files from the applicable log target resource. |
Collect CloudBees CD/RO agent logs |
Collect the agent.log and jagent.log files from the applicable log target resource. |
Collect CloudBees CD/RO repository logs |
Collect the repository.log from the applicable log target resource. |
Collect job logs |
Collect the job logs matching the job IDs provided in the CloudBees CD/RO job IDs field, from the applicable log target resource. |
CloudBees CD/RO job IDs |
Newline-separated job IDs to collect job logs. |
Collect installer logs |
Collect the corresponding CloudBees CD/RO server/agent installer logs: viz.log, installer.log, uninstaller.log, upgrade.log, and setupScripts.log files from the applicable log target resource. |
Collect Apache logs |
Collect the corresponding Apache server logs: access.log, error.log, and stdout.log files from the applicable log target resource. |
Collect user-defined logs |
Collect the user-specified log names specified in the User-defined logs field. User-defined log names need to provided with absolute paths. Wildcards are allowed. For example, /var/opt/mydir/x.log or /var/opt/mydir/*.log. |
User-defined logs |
User-defined log names need to provided with absolute paths. Wildcards are allowed. For example, /var/opt/mydir/x.log or /var/opt/mydir/*.log. |
Start timestamp |
Enter either an absolute timestamp in the format: YYYY-MM-DD HH:MM:SS or a relative timestamp as the number of days before. Valid examples are: 2017-09-03, 2017-09-03 22:15:00, and 3. 3 is interpreted as 3 days before the current time. The default is 1 day before. |
End timestamp |
Enter either an absolute timestamp in the format: YYYY-MM-DD HH:MM:SS or a relative timestamp as the number of days before. Valid examples are 2017-09-03, 2017-09-03 22:15:00, and 3. 3 is interpreted as 3 days before the current time. The default is the system time at the time of invocation. |
Filter CloudBees CD/RO server logs by job info |
Enter a job ID or job name to fetch only CloudBees CD/RO server logs that contain the job ID or name. |
Obfuscate sensitive data |
Select to obfuscate known types of sensitive data such as email, URL, and IP address. |
User-defined sensitive data |
Comma-separated list of regular expressions to identify sensitive data other than what is obfuscated by default. For example, Username: \w+ or [\w_=].+SERVICENAME=myhost.example.com\. |
Collected logs identifier |
Returns all collected logs in a .zip file named in the format: YYYY-MM-DD.zip. Add an identifier such as DEV or PROD for further categorization. For example, the categorization of DEV would result in a file named DEV-CloudBees FlowLogs-2018-09-03.zip. The default .zip file name is CloudBees FlowLogs-YYYY-MM-DD.zip. |
Result property |
Provide a property path to store run results. Results are generated to the path provided in the archivePath property. |
Release notes
EC-FlowLogCollector 2.0.0
-
Upgraded from Perl 5.8 to Perl 5.32. The EC-FlowLogCollector plugin is not backward compatible with CloudBees CD/RO 10.3 and earlier.
-
Starting with the 2.0.0 release, a new agent is required to run EC-FlowLogCollector plugin procedures.