split_mtx_debug_log.py
The split_mtx_debug_log.py script reads the specified MATRIXX debug log file, retrieves all logical log entries that match the specified input parameter, and writes them to the specified output file.
Syntax
split_mtx_debug_log.py [-h] [-d] -i input_log -o output_file -p parameter
Parameters
- -h
- Displays help information for the script.
- -d
- Runs the script so debugging information about the script is returned.
- -i input_log
- Identifies the input log file. You must specify the full path of the input log if you do not run the split_mtx_debug_log.py from the directory containing the log. By default, the input log is the mtx_debug.log file in the current directory.
- -o output_file
- Identifies the name of the output file to which the matching log entries are written. You must specify the full path of the output file if you do not want to write it to the local directory. You must have write permissions on the output directory.
- -p parameter
- Identifies a regular expression used to select the
lines to keep in the output file. The log file is read, and each line that
starts with
LM_
is checked to see if it has the regular expression. If it finds a match, the logical log entry (from the current line to the next line that starts withLM_
) is written to the output file. For example, you can search for a MATRIXX process, a server task, or a specific word, for example,heartbeat
orWARNING
. When querying MATRIXX processes, append the server name with the dynamic server number, for example,-p charging_server_2
.
Example
Extract all lines containing information about the Transaction Server
on server 1 and write them to the txn.txt file in the
/var/log/mtx directory.
Note: Because
the mtx_debug.log file is analyzed by default, you need not
specify the input file:
cd /var/log/mtx
split_mtx_debug_log.py -o txn_log.txt -p transaction_server_1