...
- Filebeat is used to forward logs from our application nodes to Logstash or Elasticsearch.
- Download and install
- Download http_ca.crt to the server (preferably in the filebeat installation location)
- Create a Logs folder inside Wildfly
Check Elasticsearch:
- Test Elasticsearch by accessing its URL in a browser: curl -X GET "localhost:9200/"
- If Elasticsearch is running correctly, you should see a JSON response with Elasticsearch cluster details.
Check Kibana:
- Go to Kibana’s dashboard by accessing its URL in a browser http://localhost:5601
- Navigate to the "Discover" section and check if logs are being indexed in Elasticsearch.
Traces:
APM agent
Copy the apm_agent folder to the server (preferably in the wildfly installation location)
File elasticapm.proerties
server_url=http://<private-ip>:8200
enable_log_correlation=true
environment=hyd-sandbox
Switch to bin/wildfly/ and edit standalone.conf.bat add below line under wildfly folder
set "JAVA_OPTS=%JAVA_OPTS% -javaagent:E:\\AppServer\\wildfly-30.0.0.Final\\wildfly-30.0.0.Final\\elastic-apm-agent-1.52.0.jar"
restart wildfly
check if traces are visible in APM section of kibana
Edit Filebeat.yml file:
filebeat.inputs:
- type: log
enabled: true
paths:
- "E:/AppServer/wildfly-30.0.0.Final/wildfly-30.0.0.Final/Logs/*.json"
json.keys_under_root: true
json.overwrite_keys: true
processors:
- add_fields:
target: ''
fields:
environment: hyd-sandbox
output.elasticsearch:
hosts: ["https://<private-ip>:9200"]
api_key: "<api-key>"
ssl:
certificate_authorities: ["C:/Program Files/Filebeat/http_ca.crt"]
index: "filebeat-%{[service.name]}-%{+yyyy.MM.dd}"setup.template.name: "filebeat"
setup.template.pattern: "filebeat-*"
setup.template.settings:
index.lifecycle.name: "90day-log-policy"
index.lifecycle.rollover_alias: "filebeat"
Check Elasticsearch:
- Test Elasticsearch by accessing its URL in a browser: curl -X GET "localhost:9200/"
- If Elasticsearch is running correctly, you should see a JSON response with Elasticsearch cluster details.
Check Kibana:
- Go to Kibana’s dashboard by accessing its URL in a browser http://localhost:5601
- Navigate to the "Discover" section and check if logs are being indexed in Elasticsearch.
Traces:
APM agent
Copy the apm_agent folder to the server (preferably in the wildfly installation location)
File elasticapm.proerties
server_url=http://<private-ip>:8200
enable_log_correlation=true
environment=hyd-sandbox
Switch to bin/wildfly/ and edit standalone.conf.bat add below line under wildfly folder
set "JAVA_OPTS=%JAVA_OPTS% -javaagent:E:\\AppServer\\wildfly-30.0.0.Final\\wildfly-30.0.0.Final\\elastic-apm-agent-1.52.0.jar"
restart wildfly
check if traces are visible in APM section of kibana
restart filebeat
check for logs under filebeat in kibana
...