Skip to content

aws_cloudwatch_logs to support json/emf #12760

@hencrice

Description

@hencrice

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Use Cases

For now it's possible to send logs in EMF format to Amazon Cloudwatch using the aws_cloudwatch_logs sink. However, without the ability to configure the request header to x-amzn-logs-format: json/emf, the CloudWatch service can not correctly parse the EMF log. Can we expose this?

Attempted Solutions

sinks:
  emfLogSink:
    type: aws_cloudwatch_logs
    inputs:
      - emfLogSrc
    region: ${AWS_REGION}
    create_missing_group: false
    create_missing_stream: true
    group_name: ${EMF_LOG_GROUP_NAME}
    stream_name: ${TEST_RACK_NAME}
    buffer:
      type: memory 
      max_events: 500
      when_full: drop_newest
    batch:
      timeout_secs: 5
      max_events: 100
    encoding:
      codec: text

Proposal

I think having a boolean flag to turn on/off adding the x-amzn-logs-format: json/emf header would be sufficient.

References

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Embedded_Metric_Format_Specification.html#CloudWatch_Embedded_Metric_Format_Specification_PutLogEvents

Version

0.21.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueAnything that is good for new contributors.sink: aws_cloudwatch_logsAnything `aws_cloudwatch_logs` sink relatedtype: featureA value-adding code addition that introduce new functionality.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions