If you are talking about AWS Console, the option to select multiple log groups is a checkbox and you can select over 20 log groups.
If you refer to the AWS CLI, you can also choose multiple log groups. First create the query (in one or more log groups) (https://docs.aws.amazon.com/cli/latest/reference/logs/start-query.html) and then get the results (https://docs.aws.amazon.com/cli/latest/reference/logs/get-query-results.html)
Example:
Query creation with multiple log groups:
aws logs start-query --log-group-names "/aws/apigateway/welcome" "/aws/lambda/Test01"
--start-time 1598936400000 --end-time 1611464400000 --query-string "fields @timestamp,
@message"
Recover result from created query:
aws logs get-query-results --query-id <query_id>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…