Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to retrieve CloudWatch Logs Insights queries filtered by query language "CWLI" #9145

Closed
1 task
cosborne83 opened this issue Dec 17, 2024 · 3 comments
Closed
1 task
Assignees
Labels
bug This issue is a bug. logs p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@cosborne83
Copy link

Describe the bug

The logs describe-queries command supports a --query-language option that should allow filtering at the API level for queries in a specific query language (CWLI, SQL or PPL). This appears to work for the "SQL" query language, but not for "CWLI".

A client-side filter using --query shows that I have logs insights queries with both "CWLI" and "SQL" query languages:

> aws logs describe-queries --query "length(queries[?queryLanguage=='CWLI'])"
52

> aws logs describe-queries --query "length(queries[?queryLanguage=='SQL'])"
20

Performing the same filtering via the API filter using the --query-language option produces the same result for "SQL" query language, but no results for the "CWLI" query language:

> aws logs describe-queries --query-language CWLI --query "length(queries)"
0

> aws logs describe-queries --query-language SQL --query "length(queries)"
20

Am I doing something wrong, or is this a bug in the CLI and/or API?

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Using the --query-language CWLI option to aws logs describe-queries should return the queries with query language "CWLI".

Current Behavior

No results are returned.

Reproduction Steps

  1. Perform a CloudWatch Logs Insights query using query language CWLI via the API/CLI/console.
  2. Run aws logs describe-queries (without the --query-language option) to confirm the query from step 1 is included in the results and that the queryLanguage is CWLI.
  3. Run aws logs describe-queries --query-language CWLI and check whether the query from step 1 is included in the results.

Possible Solution

No response

Additional Information/Context

No response

CLI version used

2.22.18

Environment details (OS name and version, etc.)

Windows 11

@cosborne83 cosborne83 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 17, 2024
@aemous aemous assigned aemous and unassigned aemous Dec 18, 2024
@RyanFitzSimmonsAK RyanFitzSimmonsAK self-assigned this Jan 16, 2025
@RyanFitzSimmonsAK RyanFitzSimmonsAK added investigating This issue is being investigated and/or work is in progress to resolve the issue. logs p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Jan 16, 2025
@RyanFitzSimmonsAK
Copy link
Contributor

Hi @cosborne83, thanks for reaching out. I was unable to reproduce this behavior on AWS CLI v2.22.18. My CWCLI queries are correctly counted regardless of if I use aws logs describe-queries --query "length(queries[?queryLanguage=='CWLI'])" or aws logs describe-queries --query-language CWLI --query "length(queries)".

Could you provide debug logs of this behavior? You can get debug logs by adding --debug to your command, and redacting any sensitive information. Thanks!

@RyanFitzSimmonsAK RyanFitzSimmonsAK added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Jan 16, 2025
@cosborne83
Copy link
Author

Thanks for investigating. I can also no longer reproduce the issue, perhaps it was a problem with the API that has since been resolved.

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. logs p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

3 participants