Link Command

Use link command to group log records into high level business transactions. This command returns the link by fields along with the following details:

  • Collection – The name of the collection where data is persisted
  • Id – Group id that is unique within the collection
  • Count – Number of log records within a group
  • Start Time – Earliest timestamp of log records within a group
  • End Time – Latest timestamp of log records within a group
  • Group Duration – Time duration of log records within a group

Syntax

link [<link_options>] <fieldName> [, <fieldName>), ...]

where link_options can be expanded as [includenulls = [true|false]] [includetrends = [true|false]] [span = <span>].

Parameters

The following table lists the parameters used in this command, along with their descriptions.

Parameter Description

includenulls

Indicates if the results should include log records where the link by fields are null. The default value is false.

includetrends

Indicates if the results should include trend data. The default value is true.

span

Sets the length of time to be used for the result histogram.

Syntax: <int><timescale>.

timescale syntax: <sec> | <min> | <hour> | <day> | <week> | <mon>

  • sec values: s | sec | secs | second | seconds
  • min values: m | min | mins | minute | minutes
  • min values: h | hr | hrs | hour | hours
  • min values: w | week | weeks
  • min values: mon | month | months

For examples of using this command in typical scenarios, see:

The following command groups all the fatal logs by transaction:

severity = fatal | link 'Transaction ID'

The following command groups all the fatal logs by transaction, and gets the average elapsed time of log records within each group:

severity = fatal | link 'Transaction ID' | stats avg('Elapsed Time (System)') as 'Average Elapsed Time'