> For the complete documentation index, see [llms.txt](https://docs.xplatform.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xplatform.com/talon/operating-applications/analysis-and-troubleshooting/tools/transaction-log-tool.md).

# Transaction Log Tool

## Overview

This page lists the usage info for the Talon transaction log tool utility.

The transaction log tool provides capabilities for browsing and querying the recovery transaction logs and inbound/outbound transaction logs recorded by an AEP Engine. The terms 'log' and 'transaction log' are used interchangeable herein for the sake of brevity.

## Basic Usage

The interactive tool supports a subset of [ReadLine](http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html) functionality. It supports familiar unix style command line operations such as command history and a limited amount of tab command completion. Executing the following command from within the tool will open all transaction logs found in the rdat folder (relative to tools working directory) and will enter the tools browse mode:

```
> open rdat
<10,4604,MY-PC> 20181118-14:15:53:144 (inf)...[RogLog->'processor-1'] Live transaction log file is 'processor-1.log' [C:\dev\nvx-app-talon-starter\target\testbed\rdat\processor-1-1]...
<10,4604,MY-PC> 20181118-14:15:53:514 (inf)...Log open (size=15825952, entries=59793) took 361 milliseconds.
<10,4604,MY-PC> 20181118-14:15:53:572 (inf)...[RogLog->'processor-1'] Scavenging old log files....
<10,4604,MY-PC> 20181118-14:15:53:572 (inf)...[RogLog->'processor-1'] ....scavenged 0 files (0 failed).
reader opened with Lazy deserialization.
rdat/processor-1>
```

Issuing the next command prints out the next entry in the log:

```
rdat/processor-1> next 1
I=InboundMsgsInTxn?
O=OutboundMsgsInTxn?
D=PossibleDup?
S=CommitStart?
E=CommitEnd?
Type |                          Class |                             ObjectId |                             ParentId |   TxnId | StblTxId|  InSeq# | OutSeq# | MsgSeq# | ChkPnt# | I | O | D | S | E
   P |                        AepFlow | 2c708c60-eb73-11e8-880f-9eb6348a2af3 |                                 null | 0000001 | 0000001 | 0000000 | 0000000 | 0000000 | 0000001 | F | F | F | F | F
   P |                     Repository | 2c7399a1-eb73-11e8-880f-9eb6348a2af3 | 2c708c60-eb73-11e8-880f-9eb6348a2af3 | 0000001 | 0000001 | 0000000 | 0000000 | 0000000 | 0000001 | F | F | F | F | F
```

The tool also supports running pre-written scripts which can be supplied to the tool via the '-s' command line when launching the tool. You can additionally run a script from within the tool using the 'script' command.

## Browse Mode

In browse mode the prompt indicates the log that is being browsed. You can switch between logs via the 'switch' command. You can navigate the log using the 'next', 'nexttxn', 'skip', 'skiptxn', and 'rewind' commands. The next command allows you to display the next entry in the log to the console. By default it uses a brief format which displays just a few details about the log entry. You can also see details of a particular log entry by passing the -d flag. You can view a number of entries at once by giving next the number of entries to display e.g. 'next 10'. See the full command usage for 'next' below.

You can dump the entire log contents to the console or to file with the 'dump' command. The dump command supports dumping the log contents in detailed, tabular, csv or html format.

## Query Mode

In query mode all logs files opened by the 'open' command can be queried with an SQL - like query syntax. You can see the list of open files by issuing 'list open'. Because transaction logs are sequential by nature, no results are displayed immediately upon execution of query because satisfying a query on indexed may require a log scan. Instead, the tool indicates whether or not it could find a suitable index to satisfy the query, and if one is found the estimated number of results in the result set. This gives the user an opportunity to create an index or refine the query. This behavior can be changed by settings the property selectPreviewCount=5, to show the first five results of a query.

You can navigate the query results using the 'next', 'skip', and 'rewind' commands. The next command allows you to display the next entry in the query results to the console. By default it uses a brief format which displays just a few details about the log entry. You can also see details of a particular log entry by passing the -d flag. See the full command usage below.

You can also dump the entire set of query results to the console or to file with the 'dump' command. The dump command supports dumping the query contents in detailed, tabular, csv or html format.

For more detailed information on querying see: [Querying Transaction Logs](/talon/operating-applications/analysis-and-troubleshooting/querying-transaction-logs.md)

## Running The Tool

### From a distribution

```bash
bin/xtxnlogtool[.sh|.bat]
```

For 1.3 and earlier:

```bash
bin/xlogtool[.sh|.bat]
```

### From a jar only distribution

The tool can be launched directly from an nvx-core-all jar, so long as you also include the jars / classes containing your messages and entities.

```bash
cd <path-to-logs-directory>
java -cp nvx-core-all.jar:<your-app-classes> com.neeve.tools.TransactionLogTool
```

For 1.3 and earlier:

```bash
cd <path-to-logs-directory>
java -cp nvx-core-all.jar:<your-app-classes> com.neeve.tools.RogLogTool
```

### From a transaction log archive

The archive command, allows you bundle up a log along with the binaries need to launch the tool into an executable jar. This makes it easy to run invoke the tool for older versions of archived logs without having to track down jars.

From 1.5 and newer:

```bash
cd <path-to-logs-directory>
java -jar <archive-name>.jar
```

The archived contents will be extracted to `<working-dir>/extracted-archives` and open automatically.

#### Specifying alternative extraction location

(since 1.9)

To specify a location different from the working directory to extract transaction log archives, one may pass in the archive extraction folder on the command line with the -e option:

```bash
cd <path-to-logs-directory>
java -jar <archive-name>.jar -e <path-to-extraction-dir>
```

In the above case, archived logs will be extracted to `<path-to-extraction-dir>/extracted-archives`.

#### Cleaning up extracted archive on tool exit.

(since 1.9)

By default contents of the extracted archive are not cleaned up on exit, to delete them on exit the deleteExtractedArchivesDirOnExit property can be set from within the tool.

```
>set deleteExtractedArchivesDirOnExit on
```

Note the above property is persistent across tool invocations as described in the 'Properties' section below.

### Scripting

#### Init Scripts

Starting with 1.9, the Transaction Log Tool now accepts a '-i' command line option that is interpreted as a comma separated list of initial scripts to run prior to entering the main command processing loop in interactive mode, or before running a script specified by the '-s' option. It is also possible to set the init scripts to run by setting -Dnv.tlt.initScripts to a comma separated list of scripts to run, though this value would be overwritten by a value specified by '-i' on the command line.

Init scripts are useful in cases where an application would always issue a set of commands at startup.

#### Batch Mode

The tool can be launched in a non interactive mode by supply a script using the -s `<scriptname>` option on the tool command line. In this mode the tool will take input from the given script file by executing each line as a separate command.

* Script lines starting with // are consider to be comments.
* Blank lines are acceptable and ignored.
* Scripts that feed the tool are expected to end with 'exit' or 'bye' command to exit the tool.
* Otherwise each line is processed as a command to the tool.

#### Script Command

A script can also be run from either interactive mode or from another script using the script command. See the script command below for more details.

## Properties (Variables)

There are two types of properties to be aware of for Talon interactive tools: Configuration Properties and Runtime Properties. The former are properties that are used to configure tool behavior and setting these values are persistent from one invocation of the tool to the next for a given user. Runtime properties are the union of Environment Properties for the host environment and System Properties.

### Setting Properties

These properties can be set in two ways:

1. set `<propName>` `<propValue>`
2. `<propName>`=`<propValue>`

### Listing Properties

The value of a property can be displayed using the get command:

```
>set message "Hi There"
>get message
|Property|   Value|     Description|
+--------+--------+----------------+
|message |Hi There|Runtime Property|
+--------+--------+----------------+
```

To list all properties one may issue get -a \[filter]

(since 1.9)

```
>get -a os.
|          Property|               Value|     Description|
+------------------+--------------------+----------------+
|os.arch           |amd64               |Runtime Property|
|os.name           |Windows NT (unknown)|Runtime Property|
|os.version        |6.2                 |Runtime Property|
|sun.os.patch.level|                    |Runtime Property|
+------------------+--------------------+----------------+
```

### Property Substitution

(since 1.9)

Scripts and user entered commands are subject to substitution with values from Runtime Properties. Any occurrence of ${propertName} will be replaced with the corresponding value from Runtime Properties if propertyName exists. Otherwise the String is left as is. It is possible to set a default value if the property is not set by using the form ${propertyName, defaultValue}

```
>message = "Hello World"
>echo ${message}
Hello World
>echo ${user.name} says "${message2, "Default Message"}"
Bob says "Default Message"
>echo ${user.name} says "${unknownProperty}
Bob says ${unknownProperty}
```

### Environment and System Properties

Environment and System properties are available to applications and can be used as variables. Any System Property set for the tool at launch is available for use by scripts or interactively entered commands. This can be useful for applications that write their own script around the transaction log tool, allowing default values for canned scripts.

### Config Properties

The following properties, augment the Transaction Log Tool's behavior. In interactive mode (non scripted), these properties are persistent from one tool invocation to another for a given user on the same machine.

## Customizing Output

Whether operating on a set of query results or browsing the log, Log Entries can be dumped in a variety of formats.

### Tabular

The default output format for results displayed in TLT is a textual tabular display.

#### Browse Mode

In browse mode a compact set of fields is shown intended primary to show relationships between objects and transaction boundaries. This view is useful in quickly seeing the sequence of operations that have occurred in a log.

```
myLog> next
I=ContainsInbound?
O=ContainsOutbound?
D=PossibleDup?
E=CommitEnd?
Type |                          Class |                             ObjectId |                             ParentId |   TxnId | StblTxId|  InSeq# | OutSeq# | MsgSeq# | ChkPnt# | I | O | D | E
   P |                       Customer | f5162d70-bfd8-11e4-8390-c48508440345 |                                 null | 0000001 | 0000000 | 0000000 | 0000000 | 0000000 | 0000000 | F | F | F | T
```

#### Query Mode

The query mode tabular view shows the fields selected by the query

```
query>SELECT firstName, lastName, customerId from logs
Query executed in 47ms.
Use 'next', 'next <count>' or 'dump' commands to display results
query>next
|           firstName|            lastName|          customerId|
+--------------------+--------------------+--------------------+
|Bob                 |null                |                   1|
+--------------------+--------------------+--------------------+
```

### CSV

This mode is enabled using the -c option with the next command or with the dump command when outputting to a file suffixed with .csv. Csv mode is useful when the data will be exported to another tool, and can also be useful where the contents shown in the tabular view are truncated due to console size limitations.

#### Browse Mode

Csv In browse mode shows a compact set of fields is shown intended primary to show relationships between objects and transaction boundaries. This view is useful in quickly seeing the sequence of operations that have occurred in a log.

```
myLog>next -c
Type,Class,ObjectId,ParentId,TxnId,StblTxId,InSeq#,OutSeq#,MsgSeq#,ChkPnt#,ContainsInbound,ContainsOutbound,PossibleDup,CommitEnd
Put,Customer,f5162d70-bfd8-11e4-8390-c48508440345,null,1,0,0,0,0,0,false,false,false,true
```

#### Query Mode

The query mode csv view shows the fields selected by the query. This mode is enabled using the -c option or with the dump command when outputing to a file suffixed with .csv.

```
query>SELECT firstName, lastName, customerId from logs
Query executed in 47ms.
Use 'next', 'next <count>' or 'dump' commands to display results
query>next -c
firstName,lastName,customerId
"Bob",null,1
```

**HTML**

HTML mode produces output to an .html suffixed file with the 'dump' command (for examaple dump myResults.html) as an html document with a table. This output has the same columns as CSV and TABULAR, but unlike tabular mode the results strings aren't truncated when placed in an html table. This mode can be useful when html formatting makes it easier to browse results.

### Detailed (Json)

Passing -d to next or dump will dump the entry in json format. This is true when in either browser or query mode: the entry corresponding to the result will be displayed in full. A detailed dump performs a dump of the Log entry which can be though of as two types of fields.

* Metadata fields: platform metadata and transaction log entry data
* Object fields: the fields of the object that was logged in the entry which which may be null if the log entry is a State Replication Remove entry.

What is displayed when dumping in detailed mode is controlled by the value of the displayMetadata configuration property:

| displayMetadata Value | Description                                      |
| --------------------- | ------------------------------------------------ |
| On                    | Show metadata along with the log entry (default) |
| Off                   | Only show the log entry object                   |
| Only                  | Show only metadata and not the object            |

#### Example

Here is an example in which a Customer entry is displayed along with entry metadata:

```
>set displayMetadata On
>next -d
 {
  "entryType" : "Put",
  "checkpointVersion" : 0,
  "className" : "com.neeve.rog.log.test.unit.messages.proto.Customer",
  "commitEnd" : true,
  "contentEncodingType" : "Protobuf",
  "entrySize" : 195,
  "filePosition" : 9,
  "id" : "f5162d70-bfd8-11e4-8390-c48508440345",
  "logName" : "testLog",
  "payloadSize" : 21,
  "simpleClassName" : "Customer",
  "stableTransactionId" : 0,
  "timestamp" : "02/28/2015 10:05:27.367PM PST",
  "transactionId" : 1,
  "ofid" : -1000,
  "otype" : 4,
  "metadata" : {
    "enqueueTs" : null,
    "enqueueTsMicros" : 0,
    "graphId" : 0,
    "inMsgsInTransaction" : false,
    "isInboundMessage" : false,
    "isInternal" : false,
    "isLastTransaction" : false,
    "isMessage" : false,
    "isOutboundMessage" : false,
    "isReplayedMessage" : false,
    "messageBus" : null,
    "messageChannel" : null,
    "messageFlow" : 0,
    "messageKey" : null,
    "messageSender" : 0,
    "messageSequenceNumber" : 0,
    "outMsgsInTransaction" : false,
    "outTs" : null,
    "outTsMicros" : 0,
    "parentId" : null,
    "preProcessingTs" : null,
    "preProcessingTsMicros" : 0,
    "possibleDuplicate" : false,
    "transactionInSequenceNumber" : 0,
    "transactionOutSequenceNumber" : 0
  },
  "object" : {
    "_xFieldBitmask_" : [ 257 ],
    "Address" : {
      "_xFieldBitmask_" : [ 8 ],
      "Zipcode" : 0,
      "City" : ""
    },
    "customerId" : 1,
    "IsVIP" : false,
    "LastOrderId" : 0,
    "Long2" : 0,
    "Integer1" : 0,
    "Integer2" : 0,
    "FirstName" : "Bob"
  }
}
```

### Filtering Unset Field Values

By default all field values in the object are displayed. If the value has not been set the the field's default value would be displayed. Note in the above example that several fields have 0 or default values, and it unclear if those values are that way because the field was explicitly set to the default value or never set to begin with. To filter unset values, the configuration property 'filterUnsetFields' can be used to filter such values:

```
query> set filterUnsetFields On
query> set displayMetadata Off
query> next -d
com.neeve.rog.log.test.unit.messages.proto.Customer:
{
  "_xFieldBitmask_" : [ 257 ],
  "Address" : {
    "_xFieldBitmask_" : [ 8 ],
    "City" : ""
  },
  "customerId" : 1,
  "FirstName" : "Bob"
}
```

Note: the "*xFieldBitmask*" field is used when deserializing the entity with the class's deserializeFromJson method.

### Json Style Formats

The Json output style format is controlled by the value of the jsonStyle configuration property.

#### Default

Jackson default pretty printer which indents output using a linefeed and 2 whitespace characters

```
>set displayMetadata Off
>set jsonStyle Default
>next -d
com.neeve.rog.log.test.unit.messages.proto.Customer:
{
  "_xFieldBitmask_" : [ 769 ],
  "customerId" : 1,
  "IsVIP" : false,
  "LastOrderId" : 0,
  "Long2" : 0,
  "Integer1" : 0,
  "Integer2" : 0,
  "FirstName" : "Mary",
  "LastName" : "Smith"
}
```

#### Minimal

This is a single line output format which is as compact as possible.

```
>set jsonStyle Minimal
>next -d
com.neeve.rog.log.test.unit.messages.proto.Customer: {"_xFieldBitmask_":[769],"customerId":1,"IsVIP":false,"LastOrderId":0,"Long2":0,"Integer1":0,"Integer2":0,"FirstName":"Mary","LastName":"Smith"}
```

#### SingleLine

The same as Minimal, but with a space after the colon separated the fieldName and value:

```
>set jsonStyle SingleLine
>next -dcom.neeve.rog.log.test.unit.messages.proto.Customer: {"_xFieldBitmask_": [769],"customerId": 1,"IsVIP": false,"LastOrderId": 0,"Long2": 0,"Integer1": 0,"Integer2": 0,"FirstName": "Mary","LastName": "Smith"}
```

#### Custom

When custom is specified the value of the Runtime Property nv.json.customPrettyPrinter is examined to look for the classname of a class that implements com.fasterxml.jackson.core.PrettyPrinter. This allows customized formatting of the output.

```
>set jsonStyle Custom
>set nv.json.customPrettyPrinter com.fasterxml.jackson.core.util.MinimalPrettyPrinter
>next -d
com.neeve.rog.log.test.unit.messages.proto.Customer: {"_xFieldBitmask_":[769],"customerId":1,"IsVIP":false,"LastOrderId":0,"Long2":0,"Integer1":0,"Integer2":0,"FirstName":"Mary","LastName":"Smith"}
```

## Dates and Times

### Timestamp Display

Where possible fields displayed within the tool will be displayed using format defined by the timestampFormat and timestampTZ tool configuration properties which can be set at any time. The timestampFormat is used for:

* Json date fields output in Json '-d' detailed views
* Tabular, CSV, HTML output values for selected or browsed field output format.

Timestamp formatting is not done:

* When an object is Selected such as SELECT Customer from logs, the Customer is displayed via it's toString implementation, and that implementation may contain timestamps that don't conform to the patterns set by timestampFormat and TimestampTZ. In this case if timestamp format is important next or dump commands should be used to replace the results.

```
query>select Customer.firstName, timestamp FROM logs
query>next
|  Customer.firstName|            Entry.timestamp|
+--------------------+---------------------------+
|Bob                 |2015-02-28 22:05:27.367 PST|
+--------------------+---------------------------+

query>set timestampFormat "MM/dd/yyyy HH:mm:ss.SSS z"
query>rewind
query>next
|  Customer.firstName|            Entry.timestamp|
+--------------------+---------------------------+
|Bob                 |02/28/2015 22:05:27.367 PST|
+--------------------+---------------------------+

query>set timestampTZ UTC
query>rewind
query>next
|  Customer.firstName|            Entry.timestamp|
+--------------------+---------------------------+
|Bob                 |03/01/2015 06:05:27.367 UTC|
+--------------------+---------------------------+

query>reset timestampTZ
query>reset timestampFormat
query>get -a timestamp
|       Property|                    Value|                         Description|
+---------------+-------------------------+------------------------------------+
|timestampFormat|yyyy-MM-dd HH:mm:ss.SSS z|The default timestamp format to use |
|               |                         |when displaying results (use quotes |
|               |                         |when setting).                      |
|timestampTZ    |DEFAULT                  |The timezone in which to display    |
|               |                         |timestamps. A value of 'DEFAULT'    |
|               |                         |uses the current system timezone    |
+---------------+-------------------------+------------------------------------+
```

{% hint style="info" %}
**Microsecond Timestamps**: Some timestamps in transaction log entry metadata fields are captured with microsecond resolution. Examples of such fields are preprocessingTs, outTs, and enqueueTs, these field contain additional 'Micros' suffixeed accessors that allow the microsecond level timestamp to be retrieved, for example preProcessingTsMicros, outTsMicros and enqueueTsMicros. The transaction log tool doesn't currently support any timestamp formatting of these microsecond level timestamps; they are displayed simply as longs and may be used for computing microsecond deltas.
{% endhint %}

### Timestamp Input

TLT accepts timestamps in queries and the timestampFormat pattern can be used to parse such timestamps. Timestamp parsing in the context of queries is covered in detail in [Querying Transaction Logs](/talon/operating-applications/analysis-and-troubleshooting/querying-transaction-logs.md).

## Commands

### get

Gets a configuration or environment property

```
Usage:
  get [-h] [-a] [<propName>]

       [<-h|--help> Displays this help message (default='false')]
       [<-a|--all> flag indicating that all properties should be listed
           (default='false')]
       [propName: The name of property to get, or with -a, a filter on
           properties to list]
```

### reset

Reset a configuration or environment property to its default value

```
Usage:
  reset [-h] <propName>

       [<-h|--help> Displays this help message (default='false')]
       propName: The name of property to reset. '*' resets all properties
           to their default value.
```

### set

Sets a configuration or environment property

```
Usage:
  set [-h] [<propName>] [<propValue>]

       [<-h|--help> Displays this help message (default='false')]
       [propName: The name of property to set, if no name is set config
           properties are listed]
       [propValue: The value of the property to set. If omitted clears the
           property]
```

### stacktraces

Sets whether or not command exception stacktraces should be shown

```
Usage:
  stacktraces [-h] <enabled>

       [<-h|--help> Displays this help message (default='false')]
       enabled: <off|on|false|true> Indicates whether or not command
           exceptions should be displayed
```

### history

Displays command history

```
Usage:
  history [-h] [-c] [<n>]

       [<-h|--help> Displays this help message (default='false')]
       [<-c|--clear> Clears command history]
       [n: lists only the last 'n' lines default='1000']
```

### help

Displays help message

```
Usage:
  help [-h] [<command>]

       [<-h|--help> Displays this help message (default='false')]
       [command: When specifies displays help for that command only]
```

### ansi

Enables or disables ansi output

```
Usage:
  ansi [-h] [<value>]

       [<-h|--help> Displays this help message (default='false')]
       [value: <off|on> Turns ansi on or off. With no argument display the
           current ansi setting]
```

### echo

Displays a message or turns echo on or off

```
Usage:
  echo [-h] [<value>]

       [<-h|--help> Displays this help message (default='false')]
       [value: Displays a message or turns echo on or off. With no argument
           list the current echo setting]
       [message: A message to display default='']
```

### script

Runs a command script

```
Usage:
  script [-h] [<script>]

       [<-h|--help> Displays this help message (default='false')]
       [script: The script file to execute]
```

### bye | exit | quit

Exit the tool.

```
Usage:
  bye [-h]

       [<-h|--help> Displays this help message (default='false')]
```

### archive

Creates an executable jar archive of transaction logs

```
Usage:
  archive [-h] [-m] [-n] [-a] <log>

       [<-h|--help> Displays this help message (default='false')]
       [<-m|--includeMessageLogs> flag indicating that corresponding
           inbound and outbound message logs should also be included in the
           archive (default='false')]
       [<-n|--name> The name to use for the archive. If ommitted and a
           single log is specified its name will be used, otherwise 'archive'
           will be used.]
       [<-a|--additional> A path delimited set of
           <archive-target-dir>=<source-fileOrDir-path> pairs indicating
           additional files or directories to include in the archive.
           Directories are copied into the archive recursively.

           Examples
            -a
           .=conf:logs=rdat/xserver.log:logs=/root/logs/mylog.log:.=errors.txt

           Would result in
            - conf being recursively copied to conf
           in the archive
            - rdat/xserver.log being copied to
           logs/xserver.log
            - /root/logs/mylog.log being copied to
           logs/mylog.log
            - errors.txt being copied to errors.txt
           in the archive
           ]
       log: The path to the log that should be archived
       [additionalLogs: Additional logs to add to the archive]
```

### close

Close open logs and queries

```
Usage:
  close [-h] [<target>]

       [<-h|--help> Displays this help message (default='false')]
       [target: Optionally specifies the name of a log or directory to
           close.]
```

### compare

Compares two logs

```
Usage:
  compare [-h] [-v] [-c] [-m] [-s] [-l] <log1Name> <log2Name> [<outputFile>]

       [<-h|--help> Displays this help message (default='false')]
       [<-v|--verbose> Whether to dump comparison information for debugging
           purposes (default='false')]
       [<-c|--csv> indicates that csv mode should be used when displaying
           diffs in the console, otherwise a tabular format will be used
           (default='false')]
       [<-m|--metadata> Indicates that platform metadata should be
           considered as well (default='false')]
       [<-s|--state> If the two logs are state replication recovery logs,
           this flag will compare their rebuilt state (default='false')]
       [<-l|--limit> The number of divergent entries to display or dump
           once the first divergence is detected (default='5')]
       log1Name: The name of log to compare relative to the current working
           directory (no .log suffix)
       log2Name: The name of second log to compare relative to the current
           working directory (no .log suffix).
       [outputFile: The name of a file to which to dump diff results. A
           suffix of .csv will yield csv output, .html will yield html,
           otherwise a textual tabular format is used.]
```

### COUNT | count

Get the number of matching results in a query

```
Usage:
  COUNT [-h]

       [<-h|--help> Displays this help message (default='false')]
```

### create | CREATE

Creates log indexes.

```
Usage:
  create [-h]

       [<-h|--help> Displays this help message (default='false')]
       indexArgs: <optional:UNIQUE> INDEX <name> ON
           <log_name|logs>(<indexField>) indexField is specified the same as it
           would in a select or where clause.
```

### DESCRIBE | describe

Describes the fields for a given object.

```
Usage:
  DESCRIBE [-h] <type>

       [<-h|--help> Displays this help message (default='false')]
       type: The name of the type to describe, must be fully qualified e.g.
           com.mycompany.MyClass, if ambiguous
```

### drop | DROP

Drops a log index

```
Usage:
  drop [-h]

       [<-h|--help> Displays this help message (default='false')]
       name: the drop statement 'DROP INDEX <indexName>', Use 'list'
           indexes to see existing indexes
```

### dump

Dump contents of the current log or query results

```
Usage:
  dump [-h] [-d] [-r] [-g] [-o] [-s] [-x] [-n] [-f] [-p] [<dumpFile>]

       [<-h|--help> Displays this help message (default='false')]
       [<-d|--detailed> displays detailed dump of each entry (as opposed to
           default brief tabular format (default='false')]
       [<-r|--raw> writes out the entry in raw format (default='false')]
       [<-g|--group> groups dumped entries by transaction
           (default='false')]
       [<-o|--sorted> DEPRECATED -sorts transaction entries by placing
           replicated entries first followed by message entries
           (default='false')]
       [<-s|--state> builds and dumps the microservice state graph
           (default='false')]
       [<-x|--skipEntries> skips displaying entries (default='false')]
       [<-n|--noOrphan> skips displaying entries without a transaction id
           (default='false')]
       [<-f|--force> when dumping to a file that already exists, forces
           overwrite of the file. (default='false')]
       [<-p|--packets> Indicates whether or not packets should be dumped
           instead of entries (browse mode only). (default='false')]
       [dumpFile: The output file to which to dump. Suffixing with .csv
           results in csv output and with .html result in html]
```

### factories

Register a set of factories with the Talon runtime

```
Usage:
  factories [-h] <factoryFile>

       [<-h|--help> Displays this help message (default='false')]
       factoryFile: The name of file containing factories
```

### factory

Register a factory with the Talon runtime

```
Usage:
  factory [-h] <factoryClass>

       [<-h|--help> Displays this help message (default='false')]
       factoryClass: The fully qualified factory class name
```

### LIST | list

Lists objects.

```
Usage:
  LIST [-h] [-v] <type> [<filter>]

       [<-h|--help> Displays this help message (default='false')]
       [<-v|--verbose> Whether to list extra details if avaiable
           (default='false')]
       type: <schema|open|logs|commands|indexes|types> What to list. A
           value of 'indexes' lists the indexes on open logs. A value of
           'types' lists the types available for query. A value of 'logs' or
           'open' lists the currently open logs.
       [filter: An optional, case sensitive filter on list]
```

### next

Dump the contents of a number of the next entries in the log or query result to the console.

```
Usage:
  next [-h] [-r] [-d] [-c] [<count>]

       [<-h|--help> Displays this help message (default='false')]
       [<-r|--raw> writes out the raw body (default='false')]
       [<-d|--detailed> displays detailed dump of each entry (as opposed to
           a tabular format (default='false')]
       [<-c|--csv> indicates that csv mode should be used for brief format,
           otherwise a tabular format will be used (default='false')]
       [count: Number of entries to display default='1']
```

### nexttxn

This command reads the next application transaction from the log and dumps its contents to the console. An application transaction is a set of log entries grouped by the same.application transaction id. (browse mode only)

```
Usage:
  nexttxn [-h] [-d] [-c] [-o]

       [<-h|--help> Displays this help message (default='false')]
       [<-d|--detailed> displays detailed dump of each entry (as opposed to
           default brief tabular format (default='false')]
       [<-c|--csv> indicates that csv mode should be used for brief format,
           otherwise a tabular format will be used (default='false')]
       [<-o|--sorted> DEPRECATED sorts transaction entries by placing
           replicated entries first followed by message entries
           (default='false')]
```

### open

This command opens a ROG log. If looking for the log created by an application driven by an AEP engine, use the name of the AEP engine (i.e. application name) as the name of the recovery log here. You may also specify a directory to open all logs in the directory

```
Usage:
  open [-h] [-r] [-m] <log>

       [<-h|--help> Displays this help message (default='false')]
       [<-r|--repair> May be specified to indicate that the log should be
           repaired. Repair required that the file be opened in a writeable
           mode. (default='false')]
       [<-m|--mode> <r|rwd|rws|rw> Indicate the mode in which the log
           should be opened (default='r')]
       [<-p|--properties> a comma separated list of prop=value configuration
           configuration properties.] (since 3.11)
       log: The path to a log or a directory. When a directory is specified
           all logs in the directory are added.
       [additionalLogs: Additional logs or directories to add]
```

### rewind

In browse mode rewinds the browser to the start of the log. In query mode rewinde the query results to the beginning

```
Usage:
  rewind [-h]

       [<-h|--help> Displays this help message (default='false')]
```

### rewrite | writelog

Rewrites the results of the current query as a new transaction log. Note that recovering from a rewritten transaction log is an inherently unsafe operation ... removing an event from the recovery stream may result in an unrecoverable transaction log or recovery with inconsistent state. Extreme caution should be exercised when using a rewritten transaction log in a production environment.

```
Usage:
  rewrite [-h] <outputFolder>

       [<-h|--help> Displays this help message (default='false')]
       outputFolder: The output folder to which to write rewritten logs
```

### SCHEMA | schema | NAMESPACE | namespace | PACKAGE | package

Sets the default package for resolving ambiguous unqualified class references

```
Usage:
  SCHEMA [-h] [-x] [<packageName>]

       [<-h|--help> Displays this help message (default='false')]
       [<-x|--clear> Indicates that current default schema should be
           cleared (default='false')]
       [packageName: A package name e.g. com.foo or com/foo, required
           unless -x is specified]
```

### SELECT | select

Issues a select statement against one or more open logs.

```
Usage:
  SELECT [-h]

       [<-h|--help> Displays this help message (default='false')]
       query: FROM <logs> WHERE <conditions>. The keyword 'Repositories' in
           the FROM clause selects all open repositories
```

### skip

Skip over a number of log entries or query results.

```
Usage:
  skip [-h] [<count>]

       [<-h|--help> Displays this help message (default='false')]
       [count: The number of entries to skip default='1']
```

### skiptxn

Skip over a set of log transactions. (browse mode only)

```
Usage:
  skiptxn [-h] [<count>]

       [<-h|--help> Displays this help message (default='false')]
       [count: The number of transactions to skip default='1']
```

### stats

Displays log file stats for the entries read so far. (browse mode only)

```
Usage:
  stats [-h] [-a]

       [<-h|--help> Displays this help message (default='false')]
       [<-a|--all> Reads to the end of the log and display all stats
           (default='false')]
```

### switch

Switches between browse and query modes. Query mode allows queries against the open logs, whilst browse mode allows you to browse through the current log.

```
Usage:
  switch [-h] [-l] [<target>]

       [<-h|--help> Displays this help message (default='false')]
       [<-l|--list> Indicates the list of options should be displayed
           (default='false')]
       [target: The name of the log to switch to in browse mode, 'query' to
           switch to query mode or 'browse' to switch to browse mode.]
```

### tail

Tails entries in a current log (browse mode only)

```
Usage:
  tail [-h] [-t] [-s] [-o] [-d] [-f] [-i] [-p] [-c] [-n]

       [<-h|--help> Displays this help message (default='false')]
       [<-t|--transactions> Indicates that the log should tail completed
           transactions rather than entries (default='false')]
       [<-s|--stats> Indicates that aggregate log stats should be displayed
           rather than entries (default='false')]
       [<-o|--sorted> DEPRECATED: sorts transaction entries by placing
           replicated entries first followed by message entries
           (default='false')]
       [<-d|--detailed> displays detailed dump of each entry (as opposed to
           default brief tabular format (default='false')]
       [<-f|--follow> Continually follows the log file (default='false')]
       [<-i|--interval> with --follow the interval to check for new entries
           in seconds (default='1.0')]
       [<-p|--noorphan> Skips orphans (default='false')]
       [<-c|--csv> indicates that csv mode should be used for brief format,
           otherwise a tabular format will be used (default='false')]
       [<-n|--count> output the last N lines, instead of the last 10
           (default='10')]
```

## Related Topics

* [Querying Transaction Logs](/talon/operating-applications/analysis-and-troubleshooting/querying-transaction-logs.md) - Query syntax and API
* [Per Transaction Stats](/talon/operating-applications/monitoring/per-transaction-statistics.md) - Transaction statistics
* [Transactions](/talon/concepts-and-architecture/transactions.md) - Transaction concepts

## Next Steps

1. Launch the Transaction Log Tool
2. Open a recovery or transaction log
3. Explore logs using browse mode
4. Execute queries to analyze specific scenarios
5. Export results for further analysis
