Skip to content

client-cloudwatch-logs doesn't return some logs #6753

@mike-bridgefy

Description

@mike-bridgefy

Checkboxes for prior research

Describe the bug

When using the node library, data stored in cloudwatch is obtained, however it does not return the required information
package.json
... "dependencies": { "@aws-sdk/client-cloudwatch-logs": "^3.716.0", ...
We use log levels and when we try to return the logs of type "ERROR" the script returns an empty array, however if I do the same with type "INFO" it does return the information
Script

    const logs = await this._clientLogs.send(
      new FilterLogEventsCommand({
        logGroupName,
        logStreamNames,
        // filterPattern,
        filterPattern: '{$.logLevel="E*"}',
        startTime,
        endTime,
      }),
    );

If the same filter is performed in the AWS cloudwatch console, the information is returned correctly

fields @timestamp, @message, @logStream as username
| filter logLevel="ERROR"
| sort @timestamp desc
| limit 10000

Regression Issue

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

SDK version number

@aws-sdk/[email protected]

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

20.12.1

Reproduction Steps

Try to make similar filters using the library and you will see that it does not return complete information

Observed Behavior

Using the package returns different information than in the AWS console when it should be the same

Expected Behavior

We expect the same behavior by doing the filters in the library and in the AWS console

Possible Solution

No response

Additional Information/Context

No response

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.p2This is a standard priority issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions