---
title: Grouping Logs Into Transactions
description: Group queried logs into transactions.
breadcrumbs: >-
  Docs > Log Management > Log Explorer > Log Analytics > Grouping Logs Into
  Transactions
---

# Grouping Logs Into Transactions

## Overview{% #overview %}

Transactions aggregate indexed logs according to instances of a sequence of events, such as a user session or a request processed across multiple microservices.

The transaction aggregation differs from the natural group aggregation, in the sense that resulting aggregates not only include logs matching the query, but also all logs belonging to the related transactions.

You can use the following information about transactions to customize your search query:

{% dl %}

{% dt %}
Duration
{% /dt %}

{% dd %}
The difference of timestamps for the last and first log in the transaction. *This measure is automatically added*.
{% /dd %}

{% dt %}
Maximum Severity
{% /dt %}

{% dd %}
Found in logs in the transaction. *This measure is automatically added*.
{% /dd %}

{% dt %}
Find Key Items
{% /dt %}

{% dd %}
For any `facet` with string values, calculate specific log information using the `count unique`, `latest`, `earliest`, and `most frequent` operations.
{% /dd %}

{% dt %}
Get Statistics
{% /dt %}

{% dd %}
For any `measure`, calculate statistical information using the `min`, `max`, `avg`, `sum`, `median`, `pc75`, `pc90`, `pc95`, and `pc99` operations.
{% /dd %}

{% dt %}
Set Start And End Conditions
{% /dt %}

{% dd %}
Customize transaction boundaries by specifying the start and end of the transaction using distinct queries.
{% /dd %}

{% /dl %}

For example, an e-commerce website groups logs across various user actions, such as catalog search, add to cart, and checkout, to build a **Transactions** view using a common attribute such as `requestId` or `orderId`.

{% image
   source="https://datadog-docs.imgix.net/images/logs/explorer/aggregations_transactions.318db5a0e6d4aab261a4f31d9f73a66e.jpg?auto=format"
   alt="The Log Explorer showing logs grouped by transactions" /%}

Transactions support the [List Aggregates](https://docs.datadoghq.com/logs/explorer/visualize/#list-aggregates-of-logs) visualization. Clicking a transaction in the list opens the transaction side panel from which you can:

- Access all logs within that transaction
- Search specific logs within that transaction

{% image
   source="https://datadog-docs.imgix.net/images/logs/explorer/transactions_side_panel.93a0d409e62f0fdce7de4b920db4b1b8.png?auto=format"
   alt="The transaction log panel showing logs within the selected transaction" /%}

When a start or end condition is used to define a transaction, click on a transaction group in the list to open the transaction group side panel, from which you can:

- Access the transactions within that transaction group in sequence
- Access all logs within each transaction
- View statistics for each transaction and summary statistics for the entire transaction group

{% image
   source="https://datadog-docs.imgix.net/images/logs/explorer/transaction_group_side_panel.ad1e5d0290334246642e944dbcefc182.png?auto=format"
   alt="The transaction group panel showing transactions within the selected group in sequence" /%}

## Further reading{% #further-reading %}

- [Learn about the Log Explorer](https://docs.datadoghq.com/logs/explorer/)
- [Learn how to analyze your logs](https://docs.datadoghq.com/logs/explorer/analytics)
