Skip to content

[Awscloudwatch] Input creates non-ecs dotted field instead of ecs nested object. #43714

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

Open
leandrojmp opened this issue Apr 5, 2025 · 1 comment
Labels
needs_team Indicates that the issue/PR needs a Team:* label

Comments

@leandrojmp
Copy link
Contributor

leandrojmp commented Apr 5, 2025

Hello,

The awscloudwatch input creates some fields with information about the log group, log stream and ingestion time.

  • aws.cloudwatch.log_group
  • aws.cloudwatch.log_stream
  • aws.cloudwatch.ingestion_time

For this to be ecs compliant it would be expected for the resulting document to have the following structure:

{
    "aws": {
        "cloudwatch": {
            "log_group": "somevalue",
            "log_stream": "somevalue",
            "ingestion_time": "someValue"
        }
    }
}

But in the document the structure is this one:

{
    "aws.cloudwatch": {
        "log_group": "somevalue",
        "log_stream": "somevalue",
        "ingestion_time": "someValue"
        }
}

We have a field with a literal dot in it, which leads to confusion and can lead to problems in ingest pipelines as well.

Those fields are being created in this part of the code:

"aws.cloudwatch": mapstr.M{
    "log_group":      logGroupId,
    "log_stream":     *logEvent.LogStreamName,
    "ingestion_time": time.Unix(*logEvent.IngestionTime/1000, 0),
},

It seems that this needs to be changed to something like this:

"aws": mapstr.M{
	"cloudwatch": mapstr.M{
		"log_group":      logGroupId,
		"log_stream":     *logEvent.LogStreamName,
		"ingestion_time": time.Unix(*logEvent.IngestionTime/1000, 0),
	}
},

I've opened an issue about this a couple of years ago in the integrations repository, but it went stale.

There was a PR to fix a similar issue in the same input with the field log.file.path here: #41099

Since we are nearing version 9.0 I opened the same PR here in the beats repository.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Apr 5, 2025
@botelastic
Copy link

botelastic bot commented Apr 5, 2025

This issue doesn't have a Team:<team> label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

No branches or pull requests

1 participant