Skip to content

Add views #275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jun 12, 2025
Merged
1 change: 1 addition & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
"query-data/stream",
"query-data/explore",
"query-data/visualizations",
"query-data/views",
"query-data/virtual-fields",
"query-data/traces"
]
Expand Down
7 changes: 7 additions & 0 deletions query-data/datasets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ When you select a dataset, Axiom displays the list of fields within the dataset
This view flattens field names with dot notation. This means that the event `{"foo": { "bar": "baz" }}` appears as `foo.bar`. Field names containing periods (`.`) are folded.

On the right, you see the following:
- [Views](#views)
- [Saved queries](#saved-queries)
- [Query history](#query-history)

Expand Down Expand Up @@ -57,6 +58,12 @@ For more information, see [Virtual fields](/query-data/virtual-fields).

Map fields are a special type of field that can hold a collection of nested key-value pairs within a single field. You can think of the content of a map field as a JSON object. The Dataset tab enables you to create map fields, and view unused and removed map fields. For more information, see [Map fields](/apl/data-types/map-fields#create-map-fields).

## Views

Views allow you to apply commonly-used filters and transformations to your dataset. The result is a view that you can use similarly to how you use datasets. The concept of a view in Axiom is similar to the concept of a virtual table in a database.

For more information, see [Views](/query-data/views).

## Queries

Every query has a unique ID that you can save and share with your team members. The Datasets tab allows you to do the following:
Expand Down
44 changes: 44 additions & 0 deletions query-data/views.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: 'Views'
description: 'This page explains how to use views in Axiom.'
---

Views allow you to apply commonly-used filters and transformations to your dataset. The result is a view that you can use like you use datasets:

- You can reference views in queries, dashboards, and monitors in the same way you reference datasets. For example, you can create queries that look for data in a view and you can use this query to [visualize data](/query-data/explore) in the Query tab, create a [dashboard element](/dashboard-elements/overview), or set up a [monitor](/monitor-data/monitors).
- You can share and control access to views in the same way you do with datasets using role-based access control (RBAC). For example, views allow you to grant other users scoped access to your datasets. This means that instead of sharing the whole dataset with other users, you have the option to share only a filtered and transformed representation of the data. You define a view using a query that applies filters and transformations to your dataset, and then you only share the results of this query with another user.

Contrary to datasets:

- You can’t ingest directly to a view.
- You can’t trim or delete data from a view.
- You can’t create a view from another view.

The concept of a view in Axiom is similar to the concept of a virtual table in a database.

### Create view

1. Select a dataset.
1. In the top right of the **Views** section, click **+ Create view**.
1. Create the query using the [visual query builder](/query-data/explore#create-a-query-using-the-visual-query-builder) or the [Axiom Processing Language (APL)](/query-data/explore#create-a-query-using-apl).
1. Below the query, check the preview of the events and the fields that your query returns.
1. Name the view and optionally add a description.
1. Click **Create view**.

### Display view

1. Select a dataset.
1. In the **Views** section on the right, click the view you want to display.

### Grant access to view

All views are available to users with organization-level read access to views. You can allow users without these permissions to access an individual view in the same way you grant access to individual datasets:

1. Click <img src="/doc-assets/icons/settings.svg" className="inline-icon" alt="Settings icon" /> **Settings > Roles**.
1. Click the role with which you want to share the view or create a new role.
1. In the **Individual datasets** section, click **Add dataset**.
1. Start typing the name of the view. In the list, find the view that you want to share, and then click **Add**.
<Note>
It’s enough to grant access to the view. You don’t need to grant access to the underlying dataset.
</Note>
1. Click **Save**.