Supported PPL commands
The following reference tables show which PPL commands are supported in OpenSearch Discover for querying data in CloudWatch Logs, Amazon S3, or Security Lake, and which PPL commands are supported in CloudWatch Logs Insights. The PPL syntax supported in CloudWatch Logs Insights and that supported in OpenSearch Discover for querying CloudWatch Logs are the same, and referenced as CloudWatch Logs in the following tables.
Note
When analyzing data outside of OpenSearch Service, commands may execute differently than they do on OpenSearch indexes.
Topics
Commands
PPL command | Description | CloudWatch Logs | Amazon S3 | Security Lake | Example command |
---|---|---|---|---|---|
fields command | Displays a set of fields that needs projection. |
|
|||
where command |
Filters the data based on the conditions that you specify. |
|
|||
stats command |
Performs aggregations and calculations. |
|
|||
parse command |
Extracts a regular expression (regex) pattern from a string and displays the extracted pattern. The extracted pattern can be further used to create new fields or filter data. |
|
|||
patterns command |
Extracts log patterns from a text field and appends the results to the search result. Grouping logs by their patterns makes it easier to aggregate stats from large volumes of log data for analysis and troubleshooting. |
|
|||
sort command |
Sort the displayed results by a field name. Use sort -FieldName to sort in descending order. |
|
|||
eval command |
Modifies or processes the value of a field and stores it in a different field. This is useful to mathematically modify a column, apply string functions to a column, or apply date functions to a column. |
|
|||
rename command |
Renames one or more fields in the search result. |
|
|||
head command |
Limits the displayed query results to the frst N rows. |
|
|||
grok command |
Parses a text field with a grok pattern based on regular expression, and appends the results to the search result. |
|
|||
top command |
Finds the most frequent values for a field. |
|
|||
dedup command |
Removes duplicate entries based on the fields that you specify. |
|
|||
join command |
Joins two datasets together. |
|
|||
lookup command |
Enriches your search data by adding or replacing data from a lookup index (dimension table). You can extend fields of an index with values from a dimension table, append or replace values when lookup condition is matched |
|
|||
subquery command | Performs complex, nested queries within your Piped Processing Language (PPL) statements. |
|
|||
rare command |
Finds the least frequent values of all fields in the field list. |
|
|||
trendline command | Calculates the moving averages of fields. |
|
|||
eventstats command | Enriches your event data with calculated summary statistics. It analyzes specified fields within your events, computes various statistical measures, and then appends these results to each original event as new fields. |
|
|
||
flatten command |
Flattens a field, The field must be of this type:
|
|
|||
field summary | Calculates basic statistics for each field (count, distinct count, min, max, avg, stddev, and mean). |
|
|||
fillnull command | Fills null fields with the value that you provide. It can be used in one or more fields. |
|
|||
expand command | Breaks down a field containing multiple values into separate rows, creating a new row for each value in the specified field. |
|
|||
describe command |
Gets detailed information about the structure and metadata of tables, schemas, and catalogs |
|
Functions
PPL function | Description | CloudWatch Logs | Amazon S3 | Security Lake | Example command |
---|---|---|---|---|---|
( |
Built-in functions in PPL that can manipulate and transform string and text data within PPL queries. For example, converting case, combining strings, extracting parts, and cleaning text. |
|
|||
( |
Built-in functions for handling and transforming date and timestamp data in PPL queries. For example, date_add, date_format, datediff, and current_date. |
|
|||
( |
Built-in functions that perform calculations on multiple rows to produce a single summarized value. For example, sum, count, avg, max, and min. |
|
|||
( |
Built-in functions for performing mathematical calculations and transformations in PPL queries. For example: abs (absolute value), round (rounds numbers), sqrt (square root), pow (power calculation), and ceil (rounds up to nearest integer). |
|
|||
(Arithmetic operators ( |
Built-in functions for expressions, particularly value expressions, return a scalar value. Expressions have different types and forms. |
|
|||
( |
Built-in functions for handling IP addresses such as CIDR. |
|
|||
( |
Built-in functions for handling JSON including arrays, extracting, and validation. |
|
|||
( |
Built-in functions for handling JSON including arrays, extracting, and validation. |
|
|||
PPL cryptographic hash functions ( |
Built-in functions that allow you to generate unique fingerprints of data, which can be used for verification, comparison, or as part of more complex security protocols. |
|
Additional information for CloudWatch Logs Insights users using OpenSearch PPL
Although CloudWatch Logs Insights supports most OpenSearch PPL commands and functions, some commands and functions aren't currently supported. For example, it doesn't currently support JOIN, Lookup, or sub-queries in PPL. For a complete list of supported query commands and functions, see the Amazon CloudWatch Logs columns in the above tables.
Sample queries and quotas
The following applies to both CloudWatch Logs Insights users and OpenSearch users querying CloudWatch data.
For information about the limits that apply when querying CloudWatch Logs from OpenSearch Service, see CloudWatch Logs quotas in the Amazon CloudWatch Logs User Guide. Limits involve the number of CloudWatch Log groups you can query, the maximum concurrent queries that you can execute, the maximum query execution time, and the maximum number of rows returned in results. The limits are the same regardless of which language you use for querying CloudWatch Logs (namely, OpenSearch PPL, SQL, and Logs Insights QL).