Searching CloudWatch log groups - AWS Toolkit for VS Code

Searching CloudWatch log groups

You can use Search Log Group to search all log streams in a log group.

For detailed information about the Amazon CloudWatch Logs service, see the Working with Log Groups and Log Streams topic in the Amazon CloudWatch User Guide.

Searching log groups from the VS Code Command Palette

To search log groups from the VS Code Command Palette, complete the following steps.

For detailed information about Amazon CloudWatch Logs filters and patterns, see the Filter and pattern syntax section in the Amazon CloudWatch User Guide.

  1. From VS Code, open the Command Palette by pressing cmd+shift+p (windows: ctrl+shift+p).

  2. From the Command Palette, enter the command AWS: Search Log Group, then select it to open the search log group dialog in VS Code and follow the prompts to continue.

    Note

    From the first prompt, you have the option to switch your AWS region before proceeding to the next steps.

  3. From the Select Log Group (1/3) prompt, choose the log group you want to search.

  4. From the Select Time Filter (2/3) prompt, choose the time filter to apply to your search.

  5. From the Search Log Group... (3/3) prompt, enter your search pattern in the provided field, then press the Enter key to continue or the ESC key to cancel the search.

  6. Your search results open in the VS Code editor, when the search is complete.

Searching log groups from the AWS Explorer

To search log groups from the AWS Toolkit for Visual Studio Code Explorer, complete the following steps.

  1. From the AWS Toolkit for Visual Studio Code Explorer expand CloudWatch.

  2. Open the context menu for (right-click) the Search Log Group you want to search, then choose Search Log Group to open the search prompt.

  3. Follow the prompts by selecting a time frame to continue.

  4. When prompted, enter your search pattern in the provided field, then press the Enter key to continue or the ESC key to cancel the search.

  5. Your search results open in the VS Code editor when the search is complete.

Working with search log results

After completing a successful CloudWatch log group search, your search results open in the VS Code editor. The following procedures describe how to work with search log results.

Note

When viewing a single log stream, the following features are limited to the results in your currently-active log stream.

Saving your search log group results

To save your search log group results locally, complete the following steps.

  1. From your search log group results, choose the Save Log to File icon button, located in the upper right-hand corner of the VS Code editor.

  2. From the Save As prompt, specify the name and location you would like to save the file to.

  3. Choosing OK saves the file to your local machine.

Changing the time range the time-range

To change the time range that is active in your search log group results, complete the following steps.

  1. From your search log group results, choose the Search by date... icon button, located in the upper right-hand corner of the VS Code editor.

  2. From the Select Time Filter prompt, choose a new time range for your search log results.

  3. Your results are updated when the Select Time Filter prompt is closed.

Changing the search pattern

To change the search pattern that is active in your search log group results, complete the following steps.

  1. From your search log group results, choose the Search by Pattern... icon button, located in the upper right-hand corner of VS Code editor.

  2. From the Search Log Group prompt, enter the new search pattern in the provided field.

  3. Press the Enter key to close the prompt and update your results with the new search pattern.