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

[MetricBeat]set resource tags if dimension value is ARN #19111

Closed
kwinstonix opened this issue Jun 10, 2020 · 1 comment · Fixed by #19433
Closed

[MetricBeat]set resource tags if dimension value is ARN #19111

kwinstonix opened this issue Jun 10, 2020 · 1 comment · Fixed by #19433
Assignees
Labels
Team:Platforms Label for the Integrations - Platforms team

Comments

@kwinstonix
Copy link
Contributor

Describe the enhancement:

If dimension value is ARN,then it should be processed by findIdentifierFromARN and check the resource identifier in resourceTagMap. I find this issue in AWS shield namespace metircs

func insertTags(events map[string]mb.Event, identifier string, resourceTagMap map[string][]resourcegroupstaggingapi.Tag) {
// Check if identifier includes dimensionSeparator (comma in this case),
// split the identifier and check for each sub-identifier.
// For example, identifier might be [storageType, s3BucketName].
// And tags are only store under s3BucketName in resourceTagMap.
subIdentifiers := strings.Split(identifier, dimensionSeparator)
for _, v := range subIdentifiers {
tags := resourceTagMap[v]
if len(tags) != 0 {
// By default, replace dot "." using underscore "_" for tag keys and values
for _, tag := range tags {
events[identifier].RootFields.Put("aws.tags."+common.DeDot(*tag.Key), common.DeDot(*tag.Value))
}
continue

func findIdentifierFromARN(resourceARN string) (string, error) {

  • shield metric example
        {
            "Namespace": "DDoSProtection",
            "Dimensions": [
                {
                    "Name": "ResourceArn",
                    "Value": "arn:aws:ec2:ap-northeast-1:1111122222:elastic-ip/eipalloc-000aabbcccddd"
                },
                {
                    "Name": "AttackVector",
                    "Value": "GenericUDPReflection"
                }
            ],
            "MetricName": "DDoSAttackPacketsPerSecond"
        }

aws doc:
https://docs.aws.amazon.com/waf/latest/developerguide/monitoring-cloudwatch.html

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jun 10, 2020
@ycombinator ycombinator added the Team:Platforms Label for the Integrations - Platforms team label Jun 10, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-platforms (Team:Platforms)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Platforms Label for the Integrations - Platforms team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants