Skip to content

Commit

Permalink
Add Query tab (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
tothmano authored Oct 16, 2024
1 parent c84a8f1 commit 2c12471
Show file tree
Hide file tree
Showing 39 changed files with 297 additions and 342 deletions.
4 changes: 2 additions & 2 deletions apl/guides/migrating-from-sql-to-apl.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ tags: ['axiom documentation', 'documentation', 'axiom', 'apl', 'sql', 'guide', '

## Introduction

As data grows exponentially, organizations are continuously seeking more efficient and powerful tools to manage and analyze their data. The Explore tab, which utilizes the Axiom Processing Language (APL), is one such service that offers fast, scalable, and interactive data exploration capabilities. If you are an SQL user looking to migrate to APL, this guide will provide a gentle introduction to help you make the transition smoothly.
As data grows exponentially, organizations are continuously seeking more efficient and powerful tools to manage and analyze their data. The Query tab, which utilizes the Axiom Processing Language (APL), is one such service that offers fast, scalable, and interactive data exploration capabilities. If you are an SQL user looking to migrate to APL, this guide will provide a gentle introduction to help you make the transition smoothly.

**This tutorial will guide you through migrating SQL to APL, helping you understand key differences and providing you with query examples.**

## Introduction to Axiom Processing Language (APL)

Axiom Processing Language (APL) is the language used by the Explore tab, a fast and highly scalable data exploration service. APL is optimized for real-time and historical data analytics, making it a suitable choice for various data analysis tasks.
Axiom Processing Language (APL) is the language used by the Query tab, a fast and highly scalable data exploration service. APL is optimized for real-time and historical data analytics, making it a suitable choice for various data analysis tasks.

**Tabular operators**: In APL, there are several tabular operators that help you manipulate and filter data, similar to SQL’s SELECT, FROM, WHERE, GROUP BY, and ORDER BY clauses. Some of the commonly used tabular operators are:

Expand Down
4 changes: 2 additions & 2 deletions apl/guides/splunk-cheat-sheet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sidebarTitle: Splunk SPL
tags: ['axiom documentation', 'documentation', 'axiom', 'splunk', 'apl', 'searching', 'aggregation', 'time frames', 'sorting', 'functions']
---

Splunk and Axiom data Explorer are powerful tools for log analysis and data exploration. The data explorer interface uses Axiom Processing Language (APL). There are some differeces between the query languages for Splunk and Axiom. When transitioning from Splunk to APL, you will need to understand how to convert your Splunk SPL queries into APL.
Splunk and Axiom are powerful tools for log analysis and data exploration. The data explorer interface uses Axiom Processing Language (APL). There are some differences between the query languages for Splunk and Axiom. When transitioning from Splunk to APL, you will need to understand how to convert your Splunk SPL queries into APL.

**This guide provides a high-level mapping from Splunk to APL.**

Expand Down Expand Up @@ -289,4 +289,4 @@ In Splunk, to sort in ascending order, you must use the `reverse` operator. APL

Whether you’re just starting your transition or you’re in the thick of it, this guide can serve as a helpful roadmap to assist you in your journey from Splunk to Axiom Processing Language.

Dive into the Axiom Processing Language, start converting your Splunk queries to APL, and explore the rich capabilities of the Explore tab. Embrace the learning curve, and remember, every complex query you master is another step forward in your data analytics journey.
Dive into the Axiom Processing Language, start converting your Splunk queries to APL, and explore the rich capabilities of the Query tab. Embrace the learning curve, and remember, every complex query you master is another step forward in your data analytics journey.
2 changes: 1 addition & 1 deletion apl/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The Axiom Processing Language (APL) is a query language that is perfect for gett

## Getting Started

Go to the Explore tab and click one of your datasets to get started. The APL editor has full auto-completion so you can poke around or you can get a better understanding of all the features by using the reference menu to the left of this page.
Go to the Query tab and click one of your datasets to get started. The APL editor has full auto-completion so you can poke around or you can get a better understanding of all the features by using the reference menu to the left of this page.

## APL Query Structure

Expand Down
4 changes: 2 additions & 2 deletions apl/tutorial.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: 'Sample queries'
description: "Explore how to use APL in Axiom’s Explore tab to run queries using Tabular Operators, Scalar Functions, and Aggregation Functions."
description: "Explore how to use APL in Axiom’s Query tab to run queries using Tabular Operators, Scalar Functions, and Aggregation Functions."
sidebarTitle: Sample Queries
icon: vial
tags: ['axiom documentation', 'documentation', 'axiom', 'APL', 'tutorial', 'apl overview', 'tabular operators', 'scalar functions', 'aggregation functions']
---

In this tutorial, you’ll explore how to use APL in Axiom’s Explore tab to run queries using Tabular Operators, Scalar Functions, and Aggregation Functions.
In this tutorial, you’ll explore how to use APL in Axiom’s Query tab to run queries using Tabular Operators, Scalar Functions, and Aggregation Functions.

## Prerequisites

Expand Down
165 changes: 154 additions & 11 deletions dashboard-elements/create.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,10 @@ To create new dashboard elements:

1. [Create a dashboard](/dashboards/create) or open an existing dashboard.
1. Click <img src="/doc-assets/icons/plus.svg" className="inline-icon" alt="Add chart" /> **Add chart** in the top right corner.
1. Choose the dashboard element from the list. For more information on each dashboard element, choose one of the following:
- [Filter bar](/query-data/filters)
- [Log stream](/dashboard-elements/log-stream)
- [Scatter plot](/dashboard-elements/scatter-plot)
- [Statistic](/dashboard-elements/statistic)
- [Table](/dashboard-elements/table)
- [Time series](/dashboard-elements/time-series)
1. Choose one of the following:
- Click **Simple Query Builder** to create your chart using a visual query builder. Create a chart in the same way you create a chart in the [Datasets tab](/query-data/datasets).
- Click **Advanced Query Language** to create your chart using the Axiom Processing Language (APL). Create a chart in the same way you create a chart in the APL query builder of the [Explore tab](/query-data/explore#create-a-query-using-apl).
1. Choose the dashboard element from the list.
1. For charts, select one of the following:
- Click **Simple Query Builder** to create your chart using a [visual query builder](#create-chart-using-visual-query-builder).
- Click **Advanced Query Language** to create your chart using the Axiom Processing Language (APL). Create a chart in the same way you create a chart in the APL query builder of the [Query tab](/query-data/explore#create-a-query-using-apl).
1. Optional: [Configure chart options](/dashboard-elements/configure).
1. Click **Save**.

Expand All @@ -39,4 +33,153 @@ To change the size of the element, drag the bottom-right corner.

<Frame>
<video autoPlay muted loop playsInline className="w-full aspect-video" src="/doc-assets/videos/resize-dashboard-element.mp4"></video>
</Frame>
</Frame>

## Create chart using visual query builder

Use the query builder to create or edit queries for the selected dataset:

<Frame caption="Query builder">
<img src="/doc-assets/shots/query-builder-time-range.png" alt="Query builder" />
</Frame>

This component is a visual query builder that eases the process of building visualizations and segments of your data.

This guide walks you through the individual sections of the query builder.

### Time range

Every query has a start and end time and the time range component allows quick selection of common time ranges as well as the ability to input specific start and end timestamps:

<Frame caption="Time range">
<img src="/doc-assets/shots/time-range-22.png" alt="Time range" />
</Frame>

- Use the **Quick Range** items to quickly select popular ranges
- Use the **Custom Start/End Date** inputs to select specific times
- Use the **Resolution** items to choose between various time bucket resolutions

### Against

When a time series visualization is selected, such as `count`, the **Against** menu is enabled and it’s possible to select a historical time to compare the results of your time range too.

For example, to compare the last hour’s average response time to the same time yesterday, select `1 hr` in the time range menu, and then select `-1D` from the **Against** menu:

<Frame caption="Time range against menu">
<img src="/doc-assets/shots/compare-against.png" alt="Time range against menu" />
</Frame>

The results look like this:

<Frame caption="Time range against chart">
<img src="/doc-assets/shots/time-range-chart-1.png" alt="Time range against chart" />
</Frame>

The dotted line represents results from the base date, and the totals table includes the comparative totals.

When you add `field` to the `group by` clause, the **time range against** values are attached to each `events`.

<Frame caption="Time range against chart">
<img src="/doc-assets/shots/time-range-chart-2.png" alt="Time range against chart" />
</Frame>

### Visualizations

Axiom provides powerful visualizations that display the output of running aggregate functions across your dataset. The Visualization menu allows you to add these visualizations and, where required, input their arguments:

<Frame caption="Visualizations menu">
<img src="/doc-assets/shots/visualizations.png" alt="Visualizations menu" />
</Frame>

You can select a visualization to add it to the query. If a visualization requires an argument (such as the field and/or other parameters), the menu allows you to select eligible fields and input those arguments. Press `Enter` to complete the addition:

<Frame caption="Visualizations demo">
<img src="/doc-assets/shots/analyze-visualizations-75.gif" alt="Visualizations demo" />
</Frame>

Click Visualization in the query builder to edit it at any time.

[Learn about supported visualizations](/query-data/visualizations)

### Filters

Use the filter menu to attach filter clauses to your search.

Axiom supports AND/OR operators at the top-level as well as one level deep. This means you can create filters that would read as `status == 200 AND (method == get OR method == head) AND (user-agent contains Mozilla or user-agent contains Webkit)`.

Filters are divided up by the field type they operate on, but some may apply to more than one field type.

<Frame caption="Filters demo">
<img src="/doc-assets/shots/analyze-filters-900.gif" alt="Filters demo" />
</Frame>

#### List of filters

_String Fields_

- `==`
- `!=`
- `exists`
- `not-exists`
- `starts-with`
- `not-starts-with`
- `ends-with`
- `not-ends-with`
- `contains`
- `not-contains`
- `regexp`
- `not-regexp`

_Number Fields_

- `==`
- `!=`
- `exists`
- `not-exists`
- `>`
- `>=`
- `<`
- `<=`

_Boolean Fields_

- `==`
- `!=`
- `exists`
- `not-exists`

_Array Fields_

- `contains`
- `not-contains`
- `exists`
- `not-exists`

#### Special fields

Axiom creates the following two fields automatically for a new dataset:

- `_time` is the timestamp of the event. If the data you ingest doesn’t have a `_time` field, Axiom assigns the time of the data ingest to the events.
- `_sysTime` is the time when you ingested the data.

In most cases, you can use `_time` and `_sysTime` interchangeably. The difference between them can be useful if you experience clock skews on your event-producing systems.

### Group by (segmentation)

When visualizing data, it can be useful to segment data into specific groups to more clearly understand how the data behaves.

The Group By component enables you to add one or more fields to group events by:

<Frame caption="Group by">
<img src="/doc-assets/shots/group-by.png" alt="Group by" />
</Frame>

### Other options

#### Order

By default, Axiom automatically chooses the best ordering for results. However, you can manually set the desired order through this menu.

#### Limit

By default, Axiom chooses a reasonable limit for the query that has been passed in. However, you can control that limit manually through this component.
4 changes: 3 additions & 1 deletion dashboard-elements/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Dashboard elements are the different visual elements that you can include in you

Choose one of the following to learn more about a dashboard element:

<CardGroup cols={2}>
<Card
title="Filter bar"
icon="filter"
Expand Down Expand Up @@ -63,4 +64,5 @@ Choose one of the following to learn more about a dashboard element:
icon="chart-line"
href="/dashboard-elements/time-series"
>
</Card>
</Card>
</CardGroup>
1 change: 1 addition & 0 deletions doc-assets/icons/chart-line.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions doc-assets/icons/chart-scatter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions doc-assets/icons/many-users.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions doc-assets/icons/percent.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2c12471

Please sign in to comment.