IBM Support

Using grep to remove unwanted entries from the csserror.log file

Question & Answer


Question

The csserror.log file contains entries that do not describe a DB2® CommonStore error but other events, such as failed access to non-existing documents, requests that were canceled by users, and so on. You want to remove these entries to be able to monitor the csserror.log automatically.

Answer

To get rid of the unwanted error entries, you can use the UNIX® command grep. This command is available for Windows®, too.

To do this, create a file that contains all patterns to be removed from the csserror.log. In the following example, this file is called patterns.txt. A sample file is attached to this technote.

The following command removes every line that is listed in the file "patterns.txt" from the csserror.log:

grep -v -f patterns.txt csserror.log > csserror_file.log

The attached patterns.txt file shows a number of sample patterns that you can use. The patterns do not need to match exactly.

Here is a short explanation of the attached patterns.txt file:

\[2004/
Removes the date string of each error.log file entry.

There is no process to read data written to a pipe.
Removes the error message: "Could not process job because: There is no process to read data written to a pipe. "
(This error message occurs when a user has canceled a request.)

failed in execution. Code: 404
Removes all error messages that fail because a document cannot be found (error 404).

Additional temporary worker
Removes all error messages that indicate that an additional temporary worker has been started.
(This is not an actual error message but a warning message that can be ignored in most cases.)

^$
Removes all empty lines.

The attached sample input and output files show you how the command works and the attached patterns.txt file contains the described sample patterns.

patterns.txtexampleInput.logexampleOutput.log
[{"Product":{"code":"SS6QJP","label":"CommonStore for SAP"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Server","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"},{"code":"PF016","label":"Linux"}],"Version":"8.3","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SS6QFT","label":"CommonStore for Lotus Domino"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Server","Platform":[{"code":"PF002","label":"AIX"},{"code":"","label":"Windows NT"},{"code":"","label":"Windows XP"},{"code":"","label":"Windows 2000 Server"},{"code":"","label":"Windows Server 2003"}],"Version":"8.1;8.2;8.3","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SS6QHP","label":"CommonStore for Exchange Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Server","Platform":[{"code":"","label":"Windows 2000 Server"},{"code":"","label":"Windows Server 2003"},{"code":"","label":"Windows XP"}],"Version":"8.1;8.2;8.3","Edition":"","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

More support for:
CommonStore for SAP

Software version:
8.3

Operating system(s):
AIX, HP-UX, Solaris, Windows, Linux

Document number:
78681

Modified date:
17 June 2018

UID

swg21179444