I am not very familiar with this terrain, but I believe you can use the filter function along with the like operator. Suppose you are looking for a string that contains “Error” in your Lambda logs. Here’s a CloudWatch Logs Insights query to perform a wildcard search:
fields @timestamp, @message
| filter @message like /Error/
This query selects the @timestamp and @message fields, filters the logs to include only those with the word “Error” in the message. If you want to search for a different string, replace “Error” in the query with your desired search term.