Win $20,000. Help build the future of education. Answer the call. Learn more

Create Kibana dashboards for traditional WebSphere Application Server on Red Hat OpenShift Container Platform

Introduction

Kibana is a great log analysis tool that can be used to help visualize and display log messages in a clean and easy-to-use view. It is not a new idea to use Kibana to visualize the logs from traditional IBM® WebSphere® Application Server, and I’m sure many users are doing so using an Elasticsearch, Logstash, and Kibana (ELK) stack. This tutorial expands on the idea of visualizing traditional WebSphere Application Server logs in Kibana, but on Red Hat® OpenShift® Container Platform.

Deploy traditional WebSphere Application Server as an application in OpenShift

As of the writing of this tutorial, we do not have a traditional WebSphere Application Server operator. But we do, however, have an official traditional WebSphere Application Server Docker image, and you can follow the OpenShift guide “Creating applications using the CLI” to deploy this image using oc commands.

Furthermore, you can even choose to deploy the WebSphere Application Server Docker image directly from the OpenShift Container Platform web console, as shown in the following figure.

Deploy an image the OpenShift Container Platform web console

Set up WebSphere Application Server traditional logging

By default, the WebSphere Application Server Docker image is already configured to be in High Performance Extensible Logging (HPEL) mode. In addition, it is also set up to log in JSON format by default and is ready to work with cluster logging in OpenShift. In essence, there is no extra configuration or setup needed to continue, but you may choose to further configure your WebSphere Application Server traditional server(s) to your liking.

The following listing is an example of a log record when a server is started and ready for e-business:

{"type":"was_message", "host":"my-twas-server3-dc6f9bfbd-gq6h4", "ibm_cellName":"DefaultCell01", "ibm_nodeName":"DefaultNode01", "ibm_serverName":"server1", "ibm_sequence":"1595438068043_00000000000F9", "message":"WSVR0001I: Server server1 open for e-business", "ibm_datetime":"2020-07-22T17:14:28.043+0000", "ibm_messageId":"WSVR0001I", "ibm_threadId":"00000001", "module":"com.ibm.ws.runtime.WsServerImpl", "loglevel":"AUDIT"}

Set up cluster logging in OpenShift

Successfully setting up cluster logging will deploy an Elasticsearch, Fluentd, and Kibana (EFK) stack. Fluentd will gather logs from each of the containers running in your OpenShift Container Platform cluster. The logs are stored in Elasticsearch, and Kibana allows for the visualization of the logs.

Complete the steps listed in the IBM Knowledge Center guide “Elasticsearch, Fluentd, and Kibana” to:

  • Install cluster logging
  • Configure Fluentd to merge JSON log message body
  • View application logs in Kibana
  • Configuring and uninstalling cluster logging

At this point the EFK stack should be configured to scrape for logs from applications deployed in your OpenShift Container Platform cluster.

Optional: Enable trace for WebSphere Application Server traditional servers

If you are diagnosing issues in your apps running in the WebSphere Application Server traditional server deployment, you may find times where you choose to enable trace. The dashboard we provide is able to show both log and trace data in a way that makes it easy to filter and look for problems. That being said, this is not mandatory and is not required to get the dashboard imported and working.

To enable trace in your WAS traditional servers you, refer to the IBM Knowledge Center guide “Turning traces on and off in servers processes using scripting.”

View and visualize your traditional WebSphere Application Server logs in Kibana

You should now be able to access the Kibana web interface through a route that will automatically be deployed for you during the setup of cluster logging. Within Kibana, on the Discover tab, you should already be able to view the JSON logs from your WebSphere Application Server traditional deployment(s). But you’ll usually want to view the logs using a dashboard. You may choose to create your own, but IBM offers a sample Kibana dashboard for traditional WebSphere Application Server (GitHub).

In order to starting using the default dashboard (or any dashboard):

  1. Ensure you have at least one WebSphere Application Server traditional server running and deployed in your OKD/OpenShift Container Platform cluster. Confirm that the server is sending events and that log messages can be seen within Kibana from the Discovery tab.

  2. Refresh your project.* index pattern within Kibana.

    a. Select Management > Index Patterns.

    b. From the list of index patterns, select project.*.

    c. Click the refresh button.

    Refresh project.\* index pattern within Kibana

  3. Import the IBM default dashboard.

    a. Select Management > Saved Objects.

    b. Click the Import button to select and import the IBM default dashboard.

    Import the IBM default dashboard

You should now be able to access the dashboard from the “Dashboard” tab. The following figures are screenshots taken from the dashboard.

Filtering options

Messages logged by the servers and severities

Message and trace entries in detail

Summary

This tutorial has given you a better understanding of how you can view your WebSphere Application Server traditional JSON logs using Kibana in OpenShift Container Platform.