---
title: "ezgh trails query"
description: "Trails Query: SQL over the organization's events, run asynchronously."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ezgh trails query

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh trails query <command>
```

Part of [`ezgh trails`](/cli/reference/trails).

## Flags

This command also takes the [global flags](/cli/reference#global-flags).

## Subcommands

| Command | Description |
| --- | --- |
| [`ezgh trails query cancel`](/cli/reference/trails-query-cancel) | Cancel a queued or running query |
| [`ezgh trails query get`](/cli/reference/trails-query-get) | Show a query's status |
| [`ezgh trails query list`](/cli/reference/trails-query-list) | List query history, newest first (everyone's with audit.queries.list, else your own) |
| [`ezgh trails query results`](/cli/reference/trails-query-results) | Print a finished query's rows, or download them as CSV or JSON Lines |
| [`ezgh trails query run`](/cli/reference/trails-query-run) | Run a query: wait for it and print its rows as they're read |
| [`ezgh trails query schema`](/cli/reference/trails-query-schema) | List the trails table's columns (and, with -o json, the functions queries may use) |

Source: https://docs.ezghcloud.com/cli/reference/trails-query/index.mdx
