> For the complete documentation index, see [llms.txt](https://docs.panther.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.panther.com/~/changes/2402/pantherflow/statements.md).

# PantherFlow Statements

There are two types of PantherFlow query statements

## Overview

{% hint style="info" %}
PantherFlow is in open beta starting with Panther version 1.110, and is available to all customers. Please share any bug reports and feature requests with your Panther support team.
{% endhint %}

A PantherFlow query is composed of one or more statements. There are two types of statements: [tabular expression statements](#tabular-expression-statements) and [`let` statements](#let-statements).

Multiple statements in the same query must be separated by semicolons (`;`). The final statement does not need a semicolon.

## Tabular expression statements

A tabular expression statement is usually what comes to mind when you hear "piped query." It is composed of a data source and typically one or more [operators](/~/changes/2402/pantherflow/operators.md), separated by the pipe character (`|`). Each operator takes in data, performs its operation, then passes the transformed data on to the next operator.

{% hint style="info" %}
In [Search](/~/changes/2402/search/search-tool.md), you can begin your query with a database and table name (as shown below) or the [`union`](/~/changes/2402/pantherflow/operators.md#union) operator. If neither of these are provided, Search will use the values in the [database and table dropdown fields](/~/changes/2402/search/search-tool.md#using-database-table-and-date-range-filters).
{% endhint %}

```
panther_logs.public.aws_cloudtrail
| where accountId != '1234567'
| summarize Count=agg.count() by eventName
| extend tooHigh = Count > 100
| where tooHigh
| sort Count
| limit 10
```

## `let` statements

A `let` statement assigns a tabular expression statement to a variable. It can then be referred to and used like a table. A `let` statement is not executed until it is referred to, or "called," in a subsequent statement.&#x20;

If a `let` statement is called by a following tabular expression statement, the `let` statement must end in a semicolon (`;`).

Naming your query can be useful when you:

* Don’t want to write out the same query more than once
* Want to make it easier for others to understand what your query is doing

### Example

The following example declares a query named `elbOK`, then refers to it later.&#x20;

In this example, `elbOK` is executed exactly as it is defined in the let statement:

```
let elbOK = panther_logs.public.aws_alb
| where elbStatusCode == 200;

elbOK
```

Here, an additional operator is applied to `elbOK` within the tabular expression statement:

```
let elbOK = panther_logs.public.aws_alb
| where elbStatusCode == 200;

elbOK 
| where p_event_time > time.ago(1h)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.panther.com/~/changes/2402/pantherflow/statements.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
