# Checks

### Follow the steps below to create and execute a query using the Ascent Checks Data Source.

***

### 1. Go to the Queries Page

* Navigate to the queries page in your dashboard to begin
* In the Queries page, click on the "New Query" button to start a new query

<figure><picture><source srcset="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FIlPqQXX9RpX2eBT9MKNo%2FScreenshot%202025-01-29%20at%202.31.58%E2%80%AFPM.png?alt=media&#x26;token=990277b9-2041-466a-b073-f9e374de75d8" media="(prefers-color-scheme: dark)"><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2Fy9n7xWSkBp6QBNYHoIdQ%2FScreenshot%202025-01-29%20at%202.29.38%E2%80%AFPM.png?alt=media&#x26;token=7ccf83f8-eadc-4377-998c-aa3df29e2446" alt=""></picture><figcaption></figcaption></figure>

### 2. Select "Ascent Checks" from the Left Sidebar

* On the left sidebar, click on **Ascent Checks**. This will display a list of all available checks that you can query.

<figure><picture><source srcset="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FUEknugjw2cprnhki5laZ%2FScreenshot%202025-01-29%20at%202.32.34%E2%80%AFPM.png?alt=media&#x26;token=3e6d36bb-f877-462e-bcd5-1a9b3572a74c" media="(prefers-color-scheme: dark)"><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FdNg5CQgHQt4ApIGdQNyE%2FScreenshot%202025-01-29%20at%202.38.29%E2%80%AFPM.png?alt=media&#x26;token=32a003c9-f259-4d50-91cd-7193cb67d902" alt=""></picture><figcaption></figcaption></figure>

### 3. Expand a check to uncover more details

* From the list, expand the check you want to query by clicking on it. This will show more details about the check.

<div align="left"><figure><picture><source srcset="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FJeIO2vS3huQUtsFK6s8I%2FScreenshot%202025-01-29%20at%202.40.21%E2%80%AFPM.png?alt=media&#x26;token=fd8404a3-edb3-4aa6-af53-4294fe2972cb" media="(prefers-color-scheme: dark)"><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FbntoVQasSvths7SMogxl%2Fimage.png?alt=media&#x26;token=8e902908-1538-474e-a96a-7400cfbaa69c" alt="" width="325"></picture><figcaption></figcaption></figure></div>

### 4. Append the CheckID to the Query Editor to consume this check.

* Click on the right arrow next to the check id to append it to the query editor

<figure><picture><source srcset="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FVbYrj8LyG5ABWIQRHyO8%2FScreenshot%202025-01-29%20at%202.42.28%E2%80%AFPM.png?alt=media&#x26;token=6cb92b59-e027-4202-8d45-1536c96f08c4" media="(prefers-color-scheme: dark)"><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FVBwPBrCfXEeeiEgQxwQS%2FScreenshot%202025-01-29%20at%202.41.55%E2%80%AFPM.png?alt=media&#x26;token=158b459c-8d6a-4807-81c0-ab731086c3c1" alt=""></picture><figcaption></figcaption></figure>

### 5. Add Duration or Start/End Date

* **To use a specific time range**, enter the **start** and **end** times as Unix epoch values.
* **To query relative durations**, use the **duration** option with a human-readable format (e.g., `1d` for one day, `2h` for two hours, etc.)
* Example:
  * **Start**: `1609459200` (Unix epoch for the start time)
  * **End**: `1609545600` (Unix epoch for the end time)
  * **Duration**: `1d` (relative to the current time)

<figure><picture><source srcset="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FU2aD7syoz7N16p9JKvoL%2FScreenshot%202025-01-29%20at%202.49.42%E2%80%AFPM.png?alt=media&#x26;token=d873577d-a4f7-4ea8-85e7-2d3de12174ae" media="(prefers-color-scheme: dark)"><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FXX5mKjLMyTylXZUJpQgL%2FScreenshot%202025-01-29%20at%202.49.30%E2%80%AFPM.png?alt=media&#x26;token=e99a733e-3711-4e6a-b2fe-feec188baf14" alt=""></picture><figcaption></figcaption></figure>

### 6. Execute the Query

* Once your query is complete, click on **Execute** to run the query and see the results.

<figure><picture><source srcset="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FbBP7MmJNSMwi6xVd60Ve%2FScreenshot%202025-01-29%20at%202.50.51%E2%80%AFPM.png?alt=media&#x26;token=f1443775-15e8-4502-8c1b-35e5147f5837" media="(prefers-color-scheme: dark)"><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FNgNK0IMfSeWtreOcrbZc%2Fimage.png?alt=media&#x26;token=e3260add-e12c-4bc6-b229-3e5a8e695b67" alt=""></picture><figcaption></figcaption></figure>

{% hint style="info" %}

### Check Data Source Query Options

The query for the **Ascent Checks Data Source** is written in **YAML** format. The following options are supported:

* **check\_id** (Mandatory):\
  The `check_id` refers to the **checkguid** of the check. You can find this in the sidebar when expanding a check.
* **start (mandatory if no duration)**:\
  The **start** time, provided as a Unix epoch value, defines the beginning of the time range for your query.
* **end (mandatory if no duration)**:\
  The **end** time, also in Unix epoch format, defines the end of the time range for your query.
* **duration (mandatory if no start/end)**:\
  A human-readable format for relative durations. It supports the following units:
  * `s` for seconds
  * `m` for minutes
  * `h` for hours
  * `d` for days\
    Example: `2d` for two days ago, `1h` for one hour ago.
* **limit(optional)**:\
  The **limit** option allows you to specify the maximum number of check results to retrieve. This helps to control the size of the query results.

***

#### Query Execution Notes

* By default, results are sorted by time in **descending** chronological order.
  {% endhint %}
