Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Jan 22, 2024 9:35:30 PM
Apr 14, 2021 5:36:22 PM
This article introduces the best practices that Talend suggests you follow when working with Filebeat in Talend JobServer and Talend ESB Runtime.
This is a continuation of the Talend Community Knowledge Base article, Talend logging using Filebeat.
The JobServer installation doesn’t include the Filebeat component, so you'll need to copy a Filebeat installation folder from another installation folder (for example the one installed with Talend logging using Filebeat) and configure a dedicated service.
TAC uses two folders dedicated to the Job generation and execution. Configure these folders on TAC by following these steps.
Change the location of the Job conductor logs on the TAC Configuration page, as follows:
These folders should be created manually on the machine, and the TAC service user should have permission on it.
Before enabling Filebeat and redirecting the logs to Log Server, you need to review the Log4j configuration for Job execution. The Job execution log doesn’t include a timestamp for each line, and this may cause Filebeat not to recognize and map all log details.
For this reason, you need to change the Log4j configuration to generate a timestamp into the log.
Open the project in Talend Studio, then select File > Edit Project properties > Log4j.
Scroll to <!-- CONSOLE appender --> and change the <param name="ConversionPattern" value="[%-5p]: %c - %m%n" /> value to:
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5p: %c - %m%n" />
Click Apply, then click OK.
Redeploy the Job.
Configure Filebeat, on the installation location, to permit Log Server to redirect logs to a specific logstash instance, by performing the following steps:
Open the %filebeat_installation%/filebeat.yml file and change output.logstash: > hosts: with the location of your Log Server, as shown below:
output.logstash: # The Logstash hosts hosts: ["logserver_ip:5044"] #hosts: ["localhost:5044"]
Change the filebeat.prospectors: section as shown below:
filebeat.prospectors:
- type: log
enabled: true
paths:
- %JOBSERVER_installation_path%/Administrator/executionLogs/*/*.log
fields:
app_id: JOBSERVER
fields_under_root: true
multiline.pattern: '([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))'
multiline.negate: true
multiline.match: after
exclude_lines: ['###']
If you want to send the entire log file to one entry, use the following command:
filebeat.prospectors:
- type: log
enabled: true
paths:
- %JOBSERVER_installation_path%/Administrator/executionLogs/*/*.log
fields:
app_id: JOBSERVER
fields_under_root: true
multiline.pattern: '([### Job STARTED'
multiline.negate: true
multiline.match: after
The following Kibana portal screenshots show logs related to Job execution:
(filter - application.keyword: “JOB_SERVER”)
On Talend 7.1, the event logging solution has been deprecated and replaced by Event Monitoring.
Event Monitoring is an implementation of Apache Karaf Decanter, monitoring solution running in Apache Karaf.
The ESB Runtime installation doesn’t include the Filebeat component, so you'll need to copy a Filebeat installation folder from another installation folder.
ESB Containers need to be configured to redirect logs to logstash. To configure and redirect all logs to the centralized Log Server, perform the following steps.
Open the %ESB_runtime_installation%/esb/%container_name%/etc/filebeat_em.yml file.
filebeat.prospectors:
- type: log
enabled: true
paths:
- ${LOG_PATH:/opt/Talend-
7.1.1/esb/%container_name_folder%/data/eventmonitoring/em*.log*}
fields:
app_id: ${APP_NAME:ESB-app}
fields_under_root: true
json.keys_under_root: true
json.message_key: log
logging.metrics.enabled: false
#----------------------------- Logstash output --------------------------------
output.logstash:
# The Logstash hosts
hosts: ["${LOGSTASH_HOSTS:logserver_ip}:${LOGSTASH_PORT:5044}"]
#hosts: ["${LOGSTASH_HOSTS:localhost}:${LOGSTASH_PORT:5044}"]
ESB container uses different log collectors, which permits sending different log categories to Log Server. Usually, not all collectors are used at the same time.
#ssh karaf@runtime_ip -p port
#tesb:start-em-default
This command starts to collect all log category to event monitoring log file (under data/eventmonitoring/em.log). This file is the one referred by Filebeat.
filebeat -e -c {KARAF_HOME}/etc/filebeat_em.yml
The following Kibana portal screenshots show logs related to ESB Runtime:
Container logs:
filter - agentid: “agent_app_log”
Karaf login logs:
filter - agentid: “agent_app_karaf”
ESB service deploy logs:
filter - agentid: “agent_app_framework”
For more information on configuring Talend components with Filebeat, see the following Talend Community Knowledge Base (KB) articles: