cloudwatchlogs

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package cloudwatchlogs scopes CloudWatchLogs-specific utiltities for Sparta

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TailWithContext added in v1.3.0

func TailWithContext(reqContext aws.Context,
	closeChan chan bool,
	awsSession *session.Session,
	logGroupName string,
	filter string,
	logger *logrus.Logger) <-chan *cloudwatchlogs.FilteredLogEvent

TailWithContext is a utiltiy function that support tailing the given log stream name using the optional filter. It returns a channel for log messages

Types

type AWSLogs

type AWSLogs struct {
	// Data is the raw, gzip'd, Base64 encoded payload.  Use
	// DecodedData() to access the log entries
	Data string `json:"data"`
}

AWSLogs is the primary key scoping CloudWatchLogs data in the lambda event

func (*AWSLogs) DecodedData

func (awsLogs *AWSLogs) DecodedData() (*CloudWatchLogEvent, error)

DecodedData returns the Base64 decoded, gunzip'd decoded data per http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/Subscriptions.html You should expect to see a response with an array of Amazon Kinesis. The Data attribute in the Amazon Kinesis record is Base64 encoded and compressed with the gzip format. You can examine the raw data from the command line using the following Unix commands: echo -n "<Content of Data>" | base64 -d | zcat

type CloudWatchLogEvent

type CloudWatchLogEvent struct {
	MessageType         string     `json:"messageType"`
	Owner               string     `json:"owner"`
	LogGroup            string     `json:"logGroup"`
	LogStream           string     `json:"logStream"`
	SubscriptionFilters []string   `json:"subscriptionFilters"`
	LogEvents           []LogEvent `json:"logEvents"`
}

CloudWatchLogEvent represents the base64 decoded, gunzip'd data

type Event

type Event struct {
	AWSLogs AWSLogs `json:"awslogs"`
}

Event data

type LogEvent

type LogEvent struct {
	ID        string `json:"id"`
	Timestamp int64  `json:"timestamp"`
	Message   string `json:"message"`
}

LogEvent represents an entry to process

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL