我要评分
获取效率
正确性
完整性
易理解

Log Parsing Submodule

Command Function

Parses log files, and calls CTF deserialization APIs to parse and output log files.

The log parsing submodule requires at least 12 GB memory space.

Syntax

1
./tracelog parser [-h | --help] [-l {0,1,2,3} | --log-level {0,1,2,3}] {-md <METADATA_FILE> | --metadata <METADATA_FILE>} {-tl <TRACELOG_FILE | TRACELOG_DIR> | --tracelog <TRACELOG_FILE | TRACELOG_DIR>} [-mf <MAP_FILE> | --mapfile <MAP_FILE>] [-o <OUTPUT_PATH> | --output <OUTPUT_PATH>]

Parameter Description

Table 1 Parameter description

Parameter

Option

Description

-h/--help

-

Obtains help information. This parameter is optional.

-l/--log-level

0/1/2/3

Log level, which defaults to 1. This parameter is optional.

  • 0: DEBUG
  • 1: INFO
  • 2: WARNING
  • 3: ERROR

-md/--metadata

-

Metadata file for parsing logs. This parameter is mandatory.

-tl/tracelog

-

Tracelog file for parsing logs or the folder for storing the tracelog file. This parameter is mandatory.

-mf/mapfile

-

ProcMaps file for parsing logs. This parameter is optional.

-o/--output

-

Path to parsed log files. This parameter is optional. If this parameter is not set, log files are outputted to the console by default.

Example

View the functions supported by the log parsing submodule:

1
./tracelog parser -h

Command output:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
NAME
    tracelog parser - Run the command to parse and view the files generated by the trace library.
USAGE
    tracelog parser
    [-h | --help]
    [-l {0,1,2,3} | --log-level {0,1,2,3}]
    {-md <METADATA_FILE> | --metadata <METADATA_FILE>}
    {-tl <TRACELOG_FILE | TRACELOG_DIR> | --tracelog <TRACELOG_FILE | TRACELOG_DIR>}
    [-mf <MAP_FILE> | --mapfile <MAP_FILE>]
    [-o <OUTPUT_PATH> | --output <OUTPUT_PATH>]
DESCRIPTION
    By default, the trace library generates log, metadata, and ProcMaps files in the /var/log directory.
    To change the path, specify the new path in the result header file of the generated code.
    For details, see the related document.
OPTIONS
    -h, --help
        Get help information and exit.
    -l {0,1,2,3}, --log-level {0,1,2,3}
        Specifies the print log level, 0(debug) | 1(info) | 2(warning) | 3(error).Default is 1(info).
    -md, --metadata
        Metadata file for parsing logs.
    -tl, --tracelog
        Tracelog file for parsing logs or the folder for storing the tracelog file.
    -mf, --mapfile
        Map file for parsing logs. By default, the map file is not specified.
    -o, --output
        Output path to parsed log files, which defaults to the standard output.