CloudWatch Insights Query Syntax
Last updated
Last updated
The following are references to common commands.
Displays a specific field or fields in query results.
Displays specific fields in query results and supports functions and operations you can use to modify field values and create new fields to use in your query.
Filters the query to return only the log events that match one or more conditions.
Automatically clusters your log data into patterns. A pattern is shared text structure that recurs among your log fields. CloudWatch Logs Insights provides ways for you to analyze the patterns found in your log events. For more information, see .
Compares the log events found in your requested time period with the log events from a previous time period of equal length, so that you can look for trends and find out if certain log events are new.
Extracts data from a log field to create an extracted field that you can process in your query. parse
supports both glob mode using wildcards, and regular expressions.
Displays the returned log events in ascending (asc
) or descending (desc
) order.
Calculate aggregate statistics using values in the log fields.
Specifies a maximum number of log events that you want your query to return. Useful with sort
to return "top 20" or "most recent 20" results.
Removes duplicate results based on specific values in fields that you specify.
Displays all the content of a log event that has some content masked because of a data protection policy. For more information about data protection in log groups, see .