Article ID: 9268, created on Nov 5, 2010, last review on Oct 13, 2014

  • Applies to:
  • Business Automation

Automatic import from KB #9268

Description

logAnalyzer.pl - the utility to analyze, cut or extract required portion of information (based on transaction ID or Function name) from PBA logs . This script should be put in /usr/local/bm/tools/LogAnalyzer (for Linux) or %ssmroot%\tools\LogAnalyzer (for Windows) and has to be invoked from this folder as well.

Usage:

# LogAnalyzer/logAnalyzer.pl -h

Utility for PBA log analyzing.

Usage: logAnalyzer.pl <options> <command> <command options>

    -h              Usage information.

Search base modificators:

    -l              Directory with logs (by default PBA log dir is used).

    -t <time_range> Analyze log in time_range, report first found suitable item.                     By default it starts from begin of logs.

                    Format: '<start_point>[@<end_point>]'

                    Date, keywords and offsets can be used as range point.

                    Date format: YY-MM-DD[ hh:mm:ss[.msec]]

                    Keywords                         start   - date of the first entry in amt.log                         end             - date of the last entry in amt.log

                    Offset format: [<base>][+]/-[<hours>h][<minutes>m][<seconds>s]                     Keywords and date can be used as base for offset. If base is not specified                     then opposite range point is used as base else 'end' is used.

                                        logAnalyzer.pl -t '10-08-11 17:55:45' function BM::PlaceOrderAndAuthorize_API                                                         from 10-08-11 17:55:45 to the end

                                        logAnalyzer.pl -t '10-08-11 17:55:45@+2h30m' function BM::PlaceOrderAndAuthorize_API                                                         from 10-08-11 17:55:45 to 10-08-11 12:25:45

                                        logAnalyzer.pl -t '-20s' function BM::PlaceOrderAndAuthorize_API                                                         from <end time> - 20s to the end

                                        logAnalyzer.pl -t 'end@start' function BM::PlaceOrderAndAuthorize_API                                                         from <end time> to <start time> in BACKWARD direction

        -c <cont,...>   List of containers to search.

        -p <maxdepth>   Depth of logs traversing

Output information modificators:

    -q              Quiet. Don't print utility specific information, only data from logs.

    -v              Verbose/debug output of logs parsing.

Special modificators:

        -u <seek_timeout>   Timeout for seeking transaction or function start. By default (60sec). -u 0 means infinite seek.

    -o <path>           Print valuable command output to file or directory (depends from command), if <path> = stdout then print to standart output.

Commands:         profile: Get profile tree by function name

        errors: Get list of errors & warnings from logs

        function: Get execution tree by function name

        profileUIRequests: Get profile stats by UI request window name

        find_line: Get transaction callstack by full line from log

        domain: Get list of domain transactions or get log of last transaction for specified method.

        uirequest: Get execution tree by UI request ID

        help: Get help on command

        transaction: Get execution tree by AMT transaction ID

        time_slice: Report slice of all logs in specified time

Example of usage on PBA for Linux installation: # cd ~bm/tools # ./logAnalyzer.pl -l ~bm/log -t "10-10-29" function BM::DestroyService # ./logAnalyzer.pl -l ~bm/log -t "10-10-28" transaction 695057 # ./logAnalyzer.pl -t "10-09-26" profile BM::PlaceOrderAndAuthorize_API # ./logAnalyzer.pl -t "10-09-30 10:00:00@1h" -c BM,www time_slice

Notes and current limitations:

1) logAnalyzer.pl - works with logs rotated in .bz2 format only. Bzip2 rotation will be enabled on customers installations after PBA 5 hotfix 1

2) It is always recommended to specify date using option "-t"

3) Error: "Can't find transaction#xxxxx start in MUXD" can be resolved by increasing timeout (-u option) or set exact time frame (-t option)

Example of usage on Windows installation:

"D:\PBA\perl\bin\perl.exe" "D:\PBA\tools\LogAnalyzer\LogAnalyzer.pl" -t "10-10-24" -l         "D:\PBA\log" transaction 347944
 "D:\PBA\perl\bin\perl.exe" "D:\PBA\tools\LogAnalyzer\LogAnalyzer.pl" -t "10-10-22" -l "D:\PBA\log" function PEMGATE::DisableAccount
 "D:\PBA\perl\bin\perl.exe" "D:\PBA\tools\LogAnalyzer\LogAnalyzer.pl" -t "10-10-22 03:00:00@1h" -c BM,www,PEMGATE,DOMAINGATE,RESELLERGATE time_slice

Scripts is included in PBA distributive starting from 5.0.1 version.

Attachments

198398b282069eaf2d94a6af87dcb3ff caea8340e2d186a540518d08602aa065 e12cea1d47a3125d335d68e6d4e15e07

Email subscription for changes to this article
Save as PDF