IBM Support

MustGather: Creating LogTargets via the Rest Management Interface on DataPower Gateway Container

Troubleshooting


Problem

When troubleshooting issues on DataPower, it is necessary to use a log target object.  For DataPower containers, the log targets can be quickly created through the Rest Management Interface.
Before going any further, ensure that you have enabled the Rest Management Interface on your DataPower Gateway.
Use this article to collect the MustGather information required for IBM DataPower Support to help diagnose and solve your problem.

Resolving The Problem

The following steps will guide you through the creation and deletion of LogTargets, as well as where to find the logs created by them.
Section 1: Creating a LogTargets to gather data
To create a LogTarget in your DP/APIC configuration, run the script found at the bottom of this document to create a logging target at the debug level in all of your DataPower Gateway pods. To run this script, you must specify three arguments to pass into it. The first is if you are creating or deleting a LogTarget, which is represented with a 1 for creation, and any other number for deletion. The second is the namespace you want to perform the task in. The third is for the domain which your namespace is in. You cannot run this script without all three arguments, and you cannot have any more than the three arguments. An example of LogTarget creation would be something such as:
./LogTargeting.sh 1 default apiconnect
This will create LogTargets on all Gateway pods within the default namespace and within the apiconnect domain on the gateway pods. If you are interested in changing the name of the LogTargets being created, open the script file and set name of the TARGETNAME variable to be what you would like. If you do not do this, the default name for your LogTarget will be "debug-log."
Section 2: Allow the targeted behavior to occur. This can take time.
Now that you have a LogTarget for your particular issue set-up in all of your pods, all you have to do is wait for the issue to present itself once again. Keep in mind that the behavior you are targeting will likely be sporadic and random, so you may have to wait some time to gather valuable data.
Section 3: Removing the LogTargets and saving their data
To delete the LogTargets you just created, you can run a command such as:
./LogTargeting.sh 0 default apiconnect
This will remove the LogTargets we just created in all Gateway pods within the default namespace and within the apiconnect domain on the gateway pods. Once all LogTargets have been deleted, you can find their data in the directory on the host device where you ran the script from. These files will follow a naming scheme such as: PodName-Timestamp-TargetName.txt. Now you can download these files and share them with your IBM Support Agent for analysis.
The LogTarget script can be found here:

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB45","label":"Automation"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSMNED","label":"IBM API Connect"},"ARM Category":[{"code":"a8m50000000L0rvAAC","label":"API Connect"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Document Information

Modified date:
13 September 2022

UID

ibm16591495