9.11.2. thl list Command

The list command to the thl command outputs a list of the sequence number information from the THL. By default, the entire THL as stored on disk is output. Command-line options enable you to select individual sequence numbers, sequence number ranges, or all the sequence information from a single file.

thl list
[-seqno # ]
[-low # ] | [-high # ]

[-file filename ] [-no-checksum ] [-sql] [-charset] [-headers] [-json]

  • -file filename

    Outputs all of the sequence number fragment information from the specified THL file. If the filename has been determined from the thl index command, or by examining the output of other fragments, the file-based output can be used to identify statements or row data within the THL.

  • -charset charset

    Specify the character set to be used to decode the character-based row data embedded within the THL event. Without this option, data is output as a hex value.

  • -hex

    For SQL that may be in different character sets, the information can be optionally output in hex format to determine the contents and context of the statement, even though the statement itself may be unreadable on the command-line.

  • -no-checksum

    Ignores checksums within the THL. In the event of a checksum failure, use of this option will enable checksums to be ignored when the THL is being read.

  • -sql

    Prints only the SQL for the selected sequence range. Use of this option can be useful if you want to extract the SQL and execute it directly by storing or piping the output.

  • -headers

    Version Support: 2.1.0 and higher

    Generates only the header information for the selected sequence numbers from the THL. For THL that contains a lot of SQL, obtaining the headers can be used to get basic content and context information without having to manually filter out the SQL in each fragment.

    The information is output as a tab-delimited list:

    2047	1412	0	false	2013-05-03 20:58:14.0	mysql-bin.000005:0000000579721045;0	host3		
    2047	1412	1	true	2013-05-03 20:58:14.0	mysql-bin.000005:0000000579721116;0	host3		
    2048	1412	0	false	2013-05-03 20:58:14.0	mysql-bin.000005:0000000580759206;0	host3		
    2048	1412	1	true	2013-05-03 20:58:14.0	mysql-bin.000005:0000000580759277;0	host3		
    2049	1412	0	false	2013-05-03 20:58:16.0	mysql-bin.000005:0000000581791468;0	host3		
    2049	1412	1	true	2013-05-03 20:58:16.0	mysql-bin.000005:0000000581791539;0	host3		
    2050	1412	0	false	2013-05-03 20:58:18.0	mysql-bin.000005:0000000582812644;0	host3

    The format of the fields output is:

    Sequence No | Epoch | Fragment | Last | Fragment | Date/Time | EventID | SourceID | Comments

    For more information on the fields displayed, see Section D.1.1, “THL Format”.

  • -json

    Version Support: 2.1.0 and higher

    Only valid with the -headers option, the header information is output for the selected sequence numbers from the THL in JSON format. The field contents are identical, with each fragment of each THL sequence being contained in a JSON object, with the output consisting of an array of the these sequence objects. For example:

    [
       {
          "lastFrag" : false,
          "epoch" : 7,
          "seqno" : 320,
          "time" : "2013-05-02 11:41:19.0",
          "frag" : 0,
          "comments" : "",
          "sourceId" : "host1",
          "eventId" : "mysql-bin.000004:0000000244490614;0"
       },
       {
          "lastFrag" : true,
          "epoch" : 7,
          "seqno" : 320,
          "time" : "2013-05-02 11:41:19.0",
          "frag" : 1,
          "comments" : "",
          "sourceId" : "host1",
          "eventId" : "mysql-bin.000004:0000000244490685;0"
       }
    ]

    For more information on the fields displayed, see THL SEQNO.