Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Latest commit

 

History

History
46 lines (33 loc) · 1.41 KB

File metadata and controls

46 lines (33 loc) · 1.41 KB

Amazon CloudWatch Logs Events

Back to Home Go Doc AWS Doc

This package allows you write AWS Lambda functions to perform custom processing and analysis on real-time feed of log events from Amazon CloudWatch Logs.

Quick Hands-On

For step by step instructions on how to author your AWS Lambda function code in Go, see eawsy/aws-lambda-go-shim.

go get -u -d github.com/eawsy/aws-lambda-go-event/...
package main

import (
	"log"

	"github.com/eawsy/aws-lambda-go-event/service/lambda/runtime/event/cloudwatchlogsevt"
	"github.com/eawsy/aws-lambda-go-core/service/lambda/runtime"
)

func Handle(evt *cloudwatchlogsevt.Event, ctx *runtime.Context) (interface{}, error) {
	for _, rec := range evt.Records {
		log.Println(rec)
	}
	return nil, nil
}