logs

package
v0.77.5 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

README

Amazon CloudWatch Logs service

This service is github.com/aws/aws-sdk-go/service/cloudwatchlogs.CloudWatchLogs proxy

To check all supported method run

    endly -s="aws/logs"

To check method contract run endly -s="aws/logs" -a=methodName

    endly -s="aws/logs" -a='filterLogs'

Op top of that

fetchLogEvents

Usage:
Filter logs
endly -r=filterLogs.yaml

@filterLogs.yaml

pipeline:
  task1:
    action: aws/logs:filterLogEvents
    credentials: aws
    loggroupname: "/aws/lambda/MsgLogFn"
    starttime: ${timestamp.5HoursAgoInUTC}    
Fetching logs with message based exclusion/inclusion (on client side)
endly -r=filterLogs.yaml

@filterLogs.yaml

pipeline:
  task1:
    action: aws/logs:filterLogEvents
    credentials: aws
    loggroupname: "/aws/lambda/MsgLogFn"
    starttime: ${timestamp.5HoursAgoInUTC}    
Log based validation
endly -r=test

@test.yaml

pipeline:
  fetchLogEvent:
    action: aws/logs:filterLogEventMessages
    logging: false
    credentials: $awsCredentials
    loggroupname: /aws/lambda/MsgLogFn
    starttime: $startTimestamp
    include:
      - '{'
  assert:
    action: validator:assert
    normalizeKVPairs: true
    actual: ${fetchLogEvent.Messages}
    expect:
      - '@indexBy@': messageAttributes.id.stringValue

      - body: /this is my 3 message/
        messageAttributes:
          id:
            stringValue: 3


      - body: /this is my 4 message/
        messageAttributes:
          id:
            stringValue: 4

Documentation

Index

Constants

View Source
const (
	//ServiceID aws Cloudwatch service id.
	ServiceID = "aws/logs"
)

Variables

This section is empty.

Functions

func GetClient

func GetClient(context *endly.Context) (*cloudwatchlogs.CloudWatchLogs, error)

GetClient returns cloudwatchlogs client from context

func New

func New() endly.Service

New creates a new AWS Cloudwatch service.

Types

type FilterLogEventMessagesInput

type FilterLogEventMessagesInput struct {
	cloudwatchlogs.FilterLogEventsInput `yaml:",inline" json:",inline"`
	Exclude                             []string //exclude log event where message contains exclude fragment
	Include                             []string //include log event where message contains include fragment
}

FilterLogEventMessagesInput represents fetch log request

type FilterLogEventMessagesOutput

type FilterLogEventMessagesOutput struct {
	Messages           []interface{}
	SearchedLogStreams []*cloudwatchlogs.SearchedLogStream
}

FilterLogEventMessagesOutput represents response

Jump to

Keyboard shortcuts

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