cloudwatchlogs

package
v1.33.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package cloudwatchlogs provides a client to make API requests to Amazon CloudWatch Logs.

Package cloudwatchlogs contains utility functions for Cloudwatch Logs client.

Index

Constants

View Source
const (
	// SleepDuration is the sleep time for making the next request for log events.
	SleepDuration = 1 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudWatchLogs

type CloudWatchLogs struct {
	// contains filtered or unexported fields
}

CloudWatchLogs wraps an AWS Cloudwatch Logs client.

func New

New returns a CloudWatchLogs configured against the input session.

func (*CloudWatchLogs) LogEvents added in v0.4.0

func (c *CloudWatchLogs) LogEvents(opts LogEventsOpts) (*LogEventsOutput, error)

LogEvents returns an array of Cloudwatch Logs events.

type Event

type Event struct {
	LogStreamName string `json:"logStreamName"`
	IngestionTime int64  `json:"ingestionTime"`
	Message       string `json:"message"`
	Timestamp     int64  `json:"timestamp"`
}

Event represents a log event.

func (*Event) HumanString

func (l *Event) HumanString() string

HumanString returns the stringified LogEvent struct with human readable format.

func (*Event) JSONString

func (l *Event) JSONString() (string, error)

JSONString returns the stringified LogEvent struct with json format.

type LogEventsOpts added in v0.4.0

type LogEventsOpts struct {
	LogGroup               string
	LogStreamPrefixFilters []string // If nil, retrieve logs from all log streams.
	Limit                  *int64
	StartTime              *int64
	EndTime                *int64
	StreamLastEventTime    map[string]int64

	LogStreamLimit int
}

LogEventsOpts wraps the parameters to call LogEvents.

type LogEventsOutput

type LogEventsOutput struct {
	// Retrieved log events.
	Events []*Event
	// Timestamp for the last event
	StreamLastEventTime map[string]int64
}

LogEventsOutput contains the output for LogEvents

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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