cloudwatchlogs

package
v0.7.5-0...-1ba5d88 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package cloudwatchlogs provides a client for Amazon CloudWatch Logs.

Index

Examples

Constants

View Source
const (
	// @enum OrderBy
	OrderByLogStreamName = "LogStreamName"
	// @enum OrderBy
	OrderByLastEventTime = "LastEventTime"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudWatchLogs

type CloudWatchLogs struct {
	*service.Service
}

This is the Amazon CloudWatch Logs API Reference. Amazon CloudWatch Logs enables you to monitor, store, and access your system, application, and custom log files. This guide provides detailed information about Amazon CloudWatch Logs actions, data types, parameters, and errors. For detailed information about Amazon CloudWatch Logs features and their associated API calls, go to the Amazon CloudWatch Developer Guide (http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide).

Use the following links to get started using the Amazon CloudWatch Logs API Reference:

Actions (http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_Operations.html):

An alphabetical list of all Amazon CloudWatch Logs actions. Data Types (http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_Types.html): An alphabetical list of all Amazon CloudWatch Logs data types. Common Parameters (http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/CommonParameters.html): Parameters that all Query actions can use. Common Errors (http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/CommonErrors.html): Client and server errors that all actions can return. Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/index.html?rande.html): Itemized regions and endpoints for all AWS products. In addition to using the Amazon CloudWatch Logs API, you can also use the following SDKs and third-party libraries to access Amazon CloudWatch Logs programmatically.

AWS SDK for Java Documentation (http://aws.amazon.com/documentation/sdkforjava/)

AWS SDK for .NET Documentation (http://aws.amazon.com/documentation/sdkfornet/) AWS SDK for PHP Documentation (http://aws.amazon.com/documentation/sdkforphp/) AWS SDK for Ruby Documentation (http://aws.amazon.com/documentation/sdkforruby/)

Developers in the AWS developer community also provide their own libraries,

which you can find at the following AWS developer centers:

AWS Java Developer Center (http://aws.amazon.com/java/) AWS PHP Developer

Center (http://aws.amazon.com/php/) AWS Python Developer Center (http://aws.amazon.com/python/) AWS Ruby Developer Center (http://aws.amazon.com/ruby/) AWS Windows and .NET Developer Center (http://aws.amazon.com/net/)

func New

func New(config *aws.Config) *CloudWatchLogs

New returns a new CloudWatchLogs client.

func (*CloudWatchLogs) CreateLogGroup

func (c *CloudWatchLogs) CreateLogGroup(input *CreateLogGroupInput) (*CreateLogGroupOutput, error)

Creates a new log group with the specified name. The name of the log group must be unique within a region for an AWS account. You can create up to 500 log groups per account.

You must use the following guidelines when naming a log group:  Log group

names can be between 1 and 512 characters long. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), '/' (forward slash), and '.' (period).

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.CreateLogGroupInput{
		LogGroupName: aws.String("LogGroupName"), // Required
	}
	resp, err := svc.CreateLogGroup(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) CreateLogGroupRequest

func (c *CloudWatchLogs) CreateLogGroupRequest(input *CreateLogGroupInput) (req *service.Request, output *CreateLogGroupOutput)

CreateLogGroupRequest generates a request for the CreateLogGroup operation.

func (*CloudWatchLogs) CreateLogStream

func (c *CloudWatchLogs) CreateLogStream(input *CreateLogStreamInput) (*CreateLogStreamOutput, error)

Creates a new log stream in the specified log group. The name of the log stream must be unique within the log group. There is no limit on the number of log streams that can exist in a log group.

You must use the following guidelines when naming a log stream:  Log stream

names can be between 1 and 512 characters long. The ':' colon character is not allowed.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.CreateLogStreamInput{
		LogGroupName:  aws.String("LogGroupName"),  // Required
		LogStreamName: aws.String("LogStreamName"), // Required
	}
	resp, err := svc.CreateLogStream(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) CreateLogStreamRequest

func (c *CloudWatchLogs) CreateLogStreamRequest(input *CreateLogStreamInput) (req *service.Request, output *CreateLogStreamOutput)

CreateLogStreamRequest generates a request for the CreateLogStream operation.

func (*CloudWatchLogs) DeleteDestination

func (c *CloudWatchLogs) DeleteDestination(input *DeleteDestinationInput) (*DeleteDestinationOutput, error)

Deletes the destination with the specified name and eventually disables all the subscription filters that publish to it. This will not delete the physical resource encapsulated by the destination.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.DeleteDestinationInput{
		DestinationName: aws.String("DestinationName"), // Required
	}
	resp, err := svc.DeleteDestination(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) DeleteDestinationRequest

func (c *CloudWatchLogs) DeleteDestinationRequest(input *DeleteDestinationInput) (req *service.Request, output *DeleteDestinationOutput)

DeleteDestinationRequest generates a request for the DeleteDestination operation.

func (*CloudWatchLogs) DeleteLogGroup

func (c *CloudWatchLogs) DeleteLogGroup(input *DeleteLogGroupInput) (*DeleteLogGroupOutput, error)

Deletes the log group with the specified name and permanently deletes all the archived log events associated with it.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.DeleteLogGroupInput{
		LogGroupName: aws.String("LogGroupName"), // Required
	}
	resp, err := svc.DeleteLogGroup(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) DeleteLogGroupRequest

func (c *CloudWatchLogs) DeleteLogGroupRequest(input *DeleteLogGroupInput) (req *service.Request, output *DeleteLogGroupOutput)

DeleteLogGroupRequest generates a request for the DeleteLogGroup operation.

func (*CloudWatchLogs) DeleteLogStream

func (c *CloudWatchLogs) DeleteLogStream(input *DeleteLogStreamInput) (*DeleteLogStreamOutput, error)

Deletes a log stream and permanently deletes all the archived log events associated with it.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.DeleteLogStreamInput{
		LogGroupName:  aws.String("LogGroupName"),  // Required
		LogStreamName: aws.String("LogStreamName"), // Required
	}
	resp, err := svc.DeleteLogStream(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) DeleteLogStreamRequest

func (c *CloudWatchLogs) DeleteLogStreamRequest(input *DeleteLogStreamInput) (req *service.Request, output *DeleteLogStreamOutput)

DeleteLogStreamRequest generates a request for the DeleteLogStream operation.

func (*CloudWatchLogs) DeleteMetricFilter

func (c *CloudWatchLogs) DeleteMetricFilter(input *DeleteMetricFilterInput) (*DeleteMetricFilterOutput, error)

Deletes a metric filter associated with the specified log group.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.DeleteMetricFilterInput{
		FilterName:   aws.String("FilterName"),   // Required
		LogGroupName: aws.String("LogGroupName"), // Required
	}
	resp, err := svc.DeleteMetricFilter(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) DeleteMetricFilterRequest

func (c *CloudWatchLogs) DeleteMetricFilterRequest(input *DeleteMetricFilterInput) (req *service.Request, output *DeleteMetricFilterOutput)

DeleteMetricFilterRequest generates a request for the DeleteMetricFilter operation.

func (*CloudWatchLogs) DeleteRetentionPolicy

func (c *CloudWatchLogs) DeleteRetentionPolicy(input *DeleteRetentionPolicyInput) (*DeleteRetentionPolicyOutput, error)

Deletes the retention policy of the specified log group. Log events would not expire if they belong to log groups without a retention policy.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.DeleteRetentionPolicyInput{
		LogGroupName: aws.String("LogGroupName"), // Required
	}
	resp, err := svc.DeleteRetentionPolicy(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) DeleteRetentionPolicyRequest

func (c *CloudWatchLogs) DeleteRetentionPolicyRequest(input *DeleteRetentionPolicyInput) (req *service.Request, output *DeleteRetentionPolicyOutput)

DeleteRetentionPolicyRequest generates a request for the DeleteRetentionPolicy operation.

func (*CloudWatchLogs) DeleteSubscriptionFilter

func (c *CloudWatchLogs) DeleteSubscriptionFilter(input *DeleteSubscriptionFilterInput) (*DeleteSubscriptionFilterOutput, error)

Deletes a subscription filter associated with the specified log group.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.DeleteSubscriptionFilterInput{
		FilterName:   aws.String("FilterName"),   // Required
		LogGroupName: aws.String("LogGroupName"), // Required
	}
	resp, err := svc.DeleteSubscriptionFilter(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) DeleteSubscriptionFilterRequest

func (c *CloudWatchLogs) DeleteSubscriptionFilterRequest(input *DeleteSubscriptionFilterInput) (req *service.Request, output *DeleteSubscriptionFilterOutput)

DeleteSubscriptionFilterRequest generates a request for the DeleteSubscriptionFilter operation.

func (*CloudWatchLogs) DescribeDestinations

func (c *CloudWatchLogs) DescribeDestinations(input *DescribeDestinationsInput) (*DescribeDestinationsOutput, error)

Returns all the destinations that are associated with the AWS account making the request. The list returned in the response is ASCII-sorted by destination name.

By default, this operation returns up to 50 destinations. If there are

more destinations to list, the response would contain a nextToken value in the response body. You can also limit the number of destinations returned in the response by specifying the limit parameter in the request.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.DescribeDestinationsInput{
		DestinationNamePrefix: aws.String("DestinationName"),
		Limit:                 aws.Int64(1),
		NextToken:             aws.String("NextToken"),
	}
	resp, err := svc.DescribeDestinations(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) DescribeDestinationsRequest

func (c *CloudWatchLogs) DescribeDestinationsRequest(input *DescribeDestinationsInput) (req *service.Request, output *DescribeDestinationsOutput)

DescribeDestinationsRequest generates a request for the DescribeDestinations operation.

func (*CloudWatchLogs) DescribeLogGroups

func (c *CloudWatchLogs) DescribeLogGroups(input *DescribeLogGroupsInput) (*DescribeLogGroupsOutput, error)

Returns all the log groups that are associated with the AWS account making the request. The list returned in the response is ASCII-sorted by log group name.

By default, this operation returns up to 50 log groups. If there are more

log groups to list, the response would contain a nextToken value in the response body. You can also limit the number of log groups returned in the response by specifying the limit parameter in the request.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.DescribeLogGroupsInput{
		Limit:              aws.Int64(1),
		LogGroupNamePrefix: aws.String("LogGroupName"),
		NextToken:          aws.String("NextToken"),
	}
	resp, err := svc.DescribeLogGroups(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) DescribeLogGroupsPages

func (c *CloudWatchLogs) DescribeLogGroupsPages(input *DescribeLogGroupsInput, fn func(p *DescribeLogGroupsOutput, lastPage bool) (shouldContinue bool)) error

func (*CloudWatchLogs) DescribeLogGroupsRequest

func (c *CloudWatchLogs) DescribeLogGroupsRequest(input *DescribeLogGroupsInput) (req *service.Request, output *DescribeLogGroupsOutput)

DescribeLogGroupsRequest generates a request for the DescribeLogGroups operation.

func (*CloudWatchLogs) DescribeLogStreams

func (c *CloudWatchLogs) DescribeLogStreams(input *DescribeLogStreamsInput) (*DescribeLogStreamsOutput, error)

Returns all the log streams that are associated with the specified log group. The list returned in the response is ASCII-sorted by log stream name.

By default, this operation returns up to 50 log streams. If there are more

log streams to list, the response would contain a nextToken value in the response body. You can also limit the number of log streams returned in the response by specifying the limit parameter in the request. This operation has a limit of five transactions per second, after which transactions are throttled.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.DescribeLogStreamsInput{
		LogGroupName:        aws.String("LogGroupName"), // Required
		Descending:          aws.Bool(true),
		Limit:               aws.Int64(1),
		LogStreamNamePrefix: aws.String("LogStreamName"),
		NextToken:           aws.String("NextToken"),
		OrderBy:             aws.String("OrderBy"),
	}
	resp, err := svc.DescribeLogStreams(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) DescribeLogStreamsPages

func (c *CloudWatchLogs) DescribeLogStreamsPages(input *DescribeLogStreamsInput, fn func(p *DescribeLogStreamsOutput, lastPage bool) (shouldContinue bool)) error

func (*CloudWatchLogs) DescribeLogStreamsRequest

func (c *CloudWatchLogs) DescribeLogStreamsRequest(input *DescribeLogStreamsInput) (req *service.Request, output *DescribeLogStreamsOutput)

DescribeLogStreamsRequest generates a request for the DescribeLogStreams operation.

func (*CloudWatchLogs) DescribeMetricFilters

func (c *CloudWatchLogs) DescribeMetricFilters(input *DescribeMetricFiltersInput) (*DescribeMetricFiltersOutput, error)

Returns all the metrics filters associated with the specified log group. The list returned in the response is ASCII-sorted by filter name.

By default, this operation returns up to 50 metric filters. If there are

more metric filters to list, the response would contain a nextToken value in the response body. You can also limit the number of metric filters returned in the response by specifying the limit parameter in the request.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.DescribeMetricFiltersInput{
		LogGroupName:     aws.String("LogGroupName"), // Required
		FilterNamePrefix: aws.String("FilterName"),
		Limit:            aws.Int64(1),
		NextToken:        aws.String("NextToken"),
	}
	resp, err := svc.DescribeMetricFilters(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) DescribeMetricFiltersPages

func (c *CloudWatchLogs) DescribeMetricFiltersPages(input *DescribeMetricFiltersInput, fn func(p *DescribeMetricFiltersOutput, lastPage bool) (shouldContinue bool)) error

func (*CloudWatchLogs) DescribeMetricFiltersRequest

func (c *CloudWatchLogs) DescribeMetricFiltersRequest(input *DescribeMetricFiltersInput) (req *service.Request, output *DescribeMetricFiltersOutput)

DescribeMetricFiltersRequest generates a request for the DescribeMetricFilters operation.

func (*CloudWatchLogs) DescribeSubscriptionFilters

Returns all the subscription filters associated with the specified log group. The list returned in the response is ASCII-sorted by filter name.

By default, this operation returns up to 50 subscription filters. If there

are more subscription filters to list, the response would contain a nextToken value in the response body. You can also limit the number of subscription filters returned in the response by specifying the limit parameter in the request.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.DescribeSubscriptionFiltersInput{
		LogGroupName:     aws.String("LogGroupName"), // Required
		FilterNamePrefix: aws.String("FilterName"),
		Limit:            aws.Int64(1),
		NextToken:        aws.String("NextToken"),
	}
	resp, err := svc.DescribeSubscriptionFilters(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) DescribeSubscriptionFiltersRequest

func (c *CloudWatchLogs) DescribeSubscriptionFiltersRequest(input *DescribeSubscriptionFiltersInput) (req *service.Request, output *DescribeSubscriptionFiltersOutput)

DescribeSubscriptionFiltersRequest generates a request for the DescribeSubscriptionFilters operation.

func (*CloudWatchLogs) FilterLogEvents

func (c *CloudWatchLogs) FilterLogEvents(input *FilterLogEventsInput) (*FilterLogEventsOutput, error)

Retrieves log events, optionally filtered by a filter pattern from the specified log group. You can provide an optional time range to filter the results on the event timestamp. You can limit the streams searched to an explicit list of logStreamNames.

By default, this operation returns as much matching log events as can fit

in a response size of 1MB, up to 10,000 log events, or all the events found within a time-bounded scan window. If the response includes a nextToken, then there is more data to search, and the search can be resumed with a new request providing the nextToken. The response will contain a list of searchedLogStreams that contains information about which streams were searched in the request and whether they have been searched completely or require further pagination. The limit parameter in the request. can be used to specify the maximum number of events to return in a page.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.FilterLogEventsInput{
		LogGroupName:  aws.String("LogGroupName"), // Required
		EndTime:       aws.Int64(1),
		FilterPattern: aws.String("FilterPattern"),
		Interleaved:   aws.Bool(true),
		Limit:         aws.Int64(1),
		LogStreamNames: []*string{
			aws.String("LogStreamName"), // Required
			// More values...
		},
		NextToken: aws.String("NextToken"),
		StartTime: aws.Int64(1),
	}
	resp, err := svc.FilterLogEvents(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) FilterLogEventsRequest

func (c *CloudWatchLogs) FilterLogEventsRequest(input *FilterLogEventsInput) (req *service.Request, output *FilterLogEventsOutput)

FilterLogEventsRequest generates a request for the FilterLogEvents operation.

func (*CloudWatchLogs) GetLogEvents

func (c *CloudWatchLogs) GetLogEvents(input *GetLogEventsInput) (*GetLogEventsOutput, error)

Retrieves log events from the specified log stream. You can provide an optional time range to filter the results on the event timestamp.

By default, this operation returns as much log events as can fit in a response

size of 1MB, up to 10,000 log events. The response will always include a nextForwardToken and a nextBackwardToken in the response body. You can use any of these tokens in subsequent GetLogEvents requests to paginate through events in either forward or backward direction. You can also limit the number of log events returned in the response by specifying the limit parameter in the request.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.GetLogEventsInput{
		LogGroupName:  aws.String("LogGroupName"),  // Required
		LogStreamName: aws.String("LogStreamName"), // Required
		EndTime:       aws.Int64(1),
		Limit:         aws.Int64(1),
		NextToken:     aws.String("NextToken"),
		StartFromHead: aws.Bool(true),
		StartTime:     aws.Int64(1),
	}
	resp, err := svc.GetLogEvents(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) GetLogEventsPages

func (c *CloudWatchLogs) GetLogEventsPages(input *GetLogEventsInput, fn func(p *GetLogEventsOutput, lastPage bool) (shouldContinue bool)) error

func (*CloudWatchLogs) GetLogEventsRequest

func (c *CloudWatchLogs) GetLogEventsRequest(input *GetLogEventsInput) (req *service.Request, output *GetLogEventsOutput)

GetLogEventsRequest generates a request for the GetLogEvents operation.

func (*CloudWatchLogs) PutDestination

func (c *CloudWatchLogs) PutDestination(input *PutDestinationInput) (*PutDestinationOutput, error)

Creates or updates a Destination. A destination encapsulates a physical resource (such as a Kinesis stream) and allows you to subscribe to a real-time stream of log events of a different account, ingested through PutLogEvents requests. Currently, the only supported physical resource is a Amazon Kinesis stream belonging to the same account as the destination.

A destination controls what is written to its Amazon Kinesis stream through

an access policy. By default, PutDestination does not set any access policy with the destination, which means a cross-account user will not be able to call PutSubscriptionFilter against this destination. To enable that, the destination owner must call PutDestinationPolicy after PutDestination.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.PutDestinationInput{
		DestinationName: aws.String("DestinationName"), // Required
		RoleArn:         aws.String("RoleArn"),         // Required
		TargetArn:       aws.String("TargetArn"),       // Required
	}
	resp, err := svc.PutDestination(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) PutDestinationPolicy

func (c *CloudWatchLogs) PutDestinationPolicy(input *PutDestinationPolicyInput) (*PutDestinationPolicyOutput, error)

Creates or updates an access policy associated with an existing Destination. An access policy is an IAM policy document (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.html) that is used to authorize claims to register a subscription filter against a given destination.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.PutDestinationPolicyInput{
		AccessPolicy:    aws.String("AccessPolicy"),    // Required
		DestinationName: aws.String("DestinationName"), // Required
	}
	resp, err := svc.PutDestinationPolicy(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) PutDestinationPolicyRequest

func (c *CloudWatchLogs) PutDestinationPolicyRequest(input *PutDestinationPolicyInput) (req *service.Request, output *PutDestinationPolicyOutput)

PutDestinationPolicyRequest generates a request for the PutDestinationPolicy operation.

func (*CloudWatchLogs) PutDestinationRequest

func (c *CloudWatchLogs) PutDestinationRequest(input *PutDestinationInput) (req *service.Request, output *PutDestinationOutput)

PutDestinationRequest generates a request for the PutDestination operation.

func (*CloudWatchLogs) PutLogEvents

func (c *CloudWatchLogs) PutLogEvents(input *PutLogEventsInput) (*PutLogEventsOutput, error)

Uploads a batch of log events to the specified log stream.

Every PutLogEvents request must include the sequenceToken obtained from

the response of the previous request. An upload in a newly created log stream does not require a sequenceToken.

The batch of events must satisfy the following constraints:  The maximum

batch size is 1,048,576 bytes, and this size is calculated as the sum of all event messages in UTF-8, plus 26 bytes for each log event. None of the log events in the batch can be more than 2 hours in the future. None of the log events in the batch can be older than 14 days or the retention period of the log group. The log events in the batch must be in chronological ordered by their timestamp. The maximum number of log events in a batch is 10,000.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.PutLogEventsInput{
		LogEvents: []*cloudwatchlogs.InputLogEvent{ // Required
			{ // Required
				Message:   aws.String("EventMessage"), // Required
				Timestamp: aws.Int64(1),               // Required
			},
			// More values...
		},
		LogGroupName:  aws.String("LogGroupName"),  // Required
		LogStreamName: aws.String("LogStreamName"), // Required
		SequenceToken: aws.String("SequenceToken"),
	}
	resp, err := svc.PutLogEvents(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) PutLogEventsRequest

func (c *CloudWatchLogs) PutLogEventsRequest(input *PutLogEventsInput) (req *service.Request, output *PutLogEventsOutput)

PutLogEventsRequest generates a request for the PutLogEvents operation.

func (*CloudWatchLogs) PutMetricFilter

func (c *CloudWatchLogs) PutMetricFilter(input *PutMetricFilterInput) (*PutMetricFilterOutput, error)

Creates or updates a metric filter and associates it with the specified log group. Metric filters allow you to configure rules to extract metric data from log events ingested through PutLogEvents requests.

The maximum number of metric filters that can be associated with a log

group is 100.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.PutMetricFilterInput{
		FilterName:    aws.String("FilterName"),    // Required
		FilterPattern: aws.String("FilterPattern"), // Required
		LogGroupName:  aws.String("LogGroupName"),  // Required
		MetricTransformations: []*cloudwatchlogs.MetricTransformation{ // Required
			{ // Required
				MetricName:      aws.String("MetricName"),      // Required
				MetricNamespace: aws.String("MetricNamespace"), // Required
				MetricValue:     aws.String("MetricValue"),     // Required
			},
			// More values...
		},
	}
	resp, err := svc.PutMetricFilter(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) PutMetricFilterRequest

func (c *CloudWatchLogs) PutMetricFilterRequest(input *PutMetricFilterInput) (req *service.Request, output *PutMetricFilterOutput)

PutMetricFilterRequest generates a request for the PutMetricFilter operation.

func (*CloudWatchLogs) PutRetentionPolicy

func (c *CloudWatchLogs) PutRetentionPolicy(input *PutRetentionPolicyInput) (*PutRetentionPolicyOutput, error)

Sets the retention of the specified log group. A retention policy allows you to configure the number of days you want to retain log events in the specified log group.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.PutRetentionPolicyInput{
		LogGroupName:    aws.String("LogGroupName"), // Required
		RetentionInDays: aws.Int64(1),               // Required
	}
	resp, err := svc.PutRetentionPolicy(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) PutRetentionPolicyRequest

func (c *CloudWatchLogs) PutRetentionPolicyRequest(input *PutRetentionPolicyInput) (req *service.Request, output *PutRetentionPolicyOutput)

PutRetentionPolicyRequest generates a request for the PutRetentionPolicy operation.

func (*CloudWatchLogs) PutSubscriptionFilter

func (c *CloudWatchLogs) PutSubscriptionFilter(input *PutSubscriptionFilterInput) (*PutSubscriptionFilterOutput, error)

Creates or updates a subscription filter and associates it with the specified log group. Subscription filters allow you to subscribe to a real-time stream of log events ingested through PutLogEvents requests and have them delivered to a specific destination. Currently, the supported destinations are: A Amazon Kinesis stream belonging to the same account as the subscription filter, for same-account delivery. A logical destination (used via an ARN of Destination) belonging to a different account, for cross-account delivery.

Currently there can only be one subscription filter associated with a log

group.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.PutSubscriptionFilterInput{
		DestinationArn: aws.String("DestinationArn"), // Required
		FilterName:     aws.String("FilterName"),     // Required
		FilterPattern:  aws.String("FilterPattern"),  // Required
		LogGroupName:   aws.String("LogGroupName"),   // Required
		RoleArn:        aws.String("RoleArn"),
	}
	resp, err := svc.PutSubscriptionFilter(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) PutSubscriptionFilterRequest

func (c *CloudWatchLogs) PutSubscriptionFilterRequest(input *PutSubscriptionFilterInput) (req *service.Request, output *PutSubscriptionFilterOutput)

PutSubscriptionFilterRequest generates a request for the PutSubscriptionFilter operation.

func (*CloudWatchLogs) TestMetricFilter

func (c *CloudWatchLogs) TestMetricFilter(input *TestMetricFilterInput) (*TestMetricFilterOutput, error)

Tests the filter pattern of a metric filter against a sample of log event messages. You can use this operation to validate the correctness of a metric filter pattern.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

func main() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.TestMetricFilterInput{
		FilterPattern: aws.String("FilterPattern"), // Required
		LogEventMessages: []*string{ // Required
			aws.String("EventMessage"), // Required
			// More values...
		},
	}
	resp, err := svc.TestMetricFilter(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Output:

func (*CloudWatchLogs) TestMetricFilterRequest

func (c *CloudWatchLogs) TestMetricFilterRequest(input *TestMetricFilterInput) (req *service.Request, output *TestMetricFilterOutput)

TestMetricFilterRequest generates a request for the TestMetricFilter operation.

type CreateLogGroupInput

type CreateLogGroupInput struct {
	// The name of the log group to create.
	LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (CreateLogGroupInput) GoString

func (s CreateLogGroupInput) GoString() string

GoString returns the string representation

func (CreateLogGroupInput) String

func (s CreateLogGroupInput) String() string

String returns the string representation

type CreateLogGroupOutput

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

func (CreateLogGroupOutput) GoString

func (s CreateLogGroupOutput) GoString() string

GoString returns the string representation

func (CreateLogGroupOutput) String

func (s CreateLogGroupOutput) String() string

String returns the string representation

type CreateLogStreamInput

type CreateLogStreamInput struct {
	// The name of the log group under which the log stream is to be created.
	LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`

	// The name of the log stream to create.
	LogStreamName *string `locationName:"logStreamName" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (CreateLogStreamInput) GoString

func (s CreateLogStreamInput) GoString() string

GoString returns the string representation

func (CreateLogStreamInput) String

func (s CreateLogStreamInput) String() string

String returns the string representation

type CreateLogStreamOutput

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

func (CreateLogStreamOutput) GoString

func (s CreateLogStreamOutput) GoString() string

GoString returns the string representation

func (CreateLogStreamOutput) String

func (s CreateLogStreamOutput) String() string

String returns the string representation

type DeleteDestinationInput

type DeleteDestinationInput struct {
	// The name of destination to delete.
	DestinationName *string `locationName:"destinationName" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (DeleteDestinationInput) GoString

func (s DeleteDestinationInput) GoString() string

GoString returns the string representation

func (DeleteDestinationInput) String

func (s DeleteDestinationInput) String() string

String returns the string representation

type DeleteDestinationOutput

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

func (DeleteDestinationOutput) GoString

func (s DeleteDestinationOutput) GoString() string

GoString returns the string representation

func (DeleteDestinationOutput) String

func (s DeleteDestinationOutput) String() string

String returns the string representation

type DeleteLogGroupInput

type DeleteLogGroupInput struct {
	// The name of the log group to delete.
	LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (DeleteLogGroupInput) GoString

func (s DeleteLogGroupInput) GoString() string

GoString returns the string representation

func (DeleteLogGroupInput) String

func (s DeleteLogGroupInput) String() string

String returns the string representation

type DeleteLogGroupOutput

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

func (DeleteLogGroupOutput) GoString

func (s DeleteLogGroupOutput) GoString() string

GoString returns the string representation

func (DeleteLogGroupOutput) String

func (s DeleteLogGroupOutput) String() string

String returns the string representation

type DeleteLogStreamInput

type DeleteLogStreamInput struct {
	// The name of the log group under which the log stream to delete belongs.
	LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`

	// The name of the log stream to delete.
	LogStreamName *string `locationName:"logStreamName" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (DeleteLogStreamInput) GoString

func (s DeleteLogStreamInput) GoString() string

GoString returns the string representation

func (DeleteLogStreamInput) String

func (s DeleteLogStreamInput) String() string

String returns the string representation

type DeleteLogStreamOutput

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

func (DeleteLogStreamOutput) GoString

func (s DeleteLogStreamOutput) GoString() string

GoString returns the string representation

func (DeleteLogStreamOutput) String

func (s DeleteLogStreamOutput) String() string

String returns the string representation

type DeleteMetricFilterInput

type DeleteMetricFilterInput struct {
	// The name of the metric filter to delete.
	FilterName *string `locationName:"filterName" type:"string" required:"true"`

	// The name of the log group that is associated with the metric filter to delete.
	LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (DeleteMetricFilterInput) GoString

func (s DeleteMetricFilterInput) GoString() string

GoString returns the string representation

func (DeleteMetricFilterInput) String

func (s DeleteMetricFilterInput) String() string

String returns the string representation

type DeleteMetricFilterOutput

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

func (DeleteMetricFilterOutput) GoString

func (s DeleteMetricFilterOutput) GoString() string

GoString returns the string representation

func (DeleteMetricFilterOutput) String

func (s DeleteMetricFilterOutput) String() string

String returns the string representation

type DeleteRetentionPolicyInput

type DeleteRetentionPolicyInput struct {
	// The name of the log group that is associated with the retention policy to
	// delete.
	LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (DeleteRetentionPolicyInput) GoString

func (s DeleteRetentionPolicyInput) GoString() string

GoString returns the string representation

func (DeleteRetentionPolicyInput) String

String returns the string representation

type DeleteRetentionPolicyOutput

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

func (DeleteRetentionPolicyOutput) GoString

func (s DeleteRetentionPolicyOutput) GoString() string

GoString returns the string representation

func (DeleteRetentionPolicyOutput) String

String returns the string representation

type DeleteSubscriptionFilterInput

type DeleteSubscriptionFilterInput struct {
	// The name of the subscription filter to delete.
	FilterName *string `locationName:"filterName" type:"string" required:"true"`

	// The name of the log group that is associated with the subscription filter
	// to delete.
	LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (DeleteSubscriptionFilterInput) GoString

GoString returns the string representation

func (DeleteSubscriptionFilterInput) String

String returns the string representation

type DeleteSubscriptionFilterOutput

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

func (DeleteSubscriptionFilterOutput) GoString

GoString returns the string representation

func (DeleteSubscriptionFilterOutput) String

String returns the string representation

type DescribeDestinationsInput

type DescribeDestinationsInput struct {
	// Will only return destinations that match the provided destinationNamePrefix.
	// If you don't specify a value, no prefix is applied.
	DestinationNamePrefix *string `type:"string"`

	// The maximum number of results to return.
	Limit *int64 `locationName:"limit" type:"integer"`

	// A string token used for pagination that points to the next page of results.
	// It must be a value obtained from the response of the previous request. The
	// token expires after 24 hours.
	NextToken *string `locationName:"nextToken" type:"string"`
	// contains filtered or unexported fields
}

func (DescribeDestinationsInput) GoString

func (s DescribeDestinationsInput) GoString() string

GoString returns the string representation

func (DescribeDestinationsInput) String

func (s DescribeDestinationsInput) String() string

String returns the string representation

type DescribeDestinationsOutput

type DescribeDestinationsOutput struct {
	Destinations []*Destination `locationName:"destinations" type:"list"`

	// A string token used for pagination that points to the next page of results.
	// It must be a value obtained from the response of the previous request. The
	// token expires after 24 hours.
	NextToken *string `locationName:"nextToken" type:"string"`
	// contains filtered or unexported fields
}

func (DescribeDestinationsOutput) GoString

func (s DescribeDestinationsOutput) GoString() string

GoString returns the string representation

func (DescribeDestinationsOutput) String

String returns the string representation

type DescribeLogGroupsInput

type DescribeLogGroupsInput struct {
	// The maximum number of items returned in the response. If you don't specify
	// a value, the request would return up to 50 items.
	Limit *int64 `locationName:"limit" type:"integer"`

	// Will only return log groups that match the provided logGroupNamePrefix. If
	// you don't specify a value, no prefix filter is applied.
	LogGroupNamePrefix *string `locationName:"logGroupNamePrefix" type:"string"`

	// A string token used for pagination that points to the next page of results.
	// It must be a value obtained from the response of the previous DescribeLogGroups
	// request.
	NextToken *string `locationName:"nextToken" type:"string"`
	// contains filtered or unexported fields
}

func (DescribeLogGroupsInput) GoString

func (s DescribeLogGroupsInput) GoString() string

GoString returns the string representation

func (DescribeLogGroupsInput) String

func (s DescribeLogGroupsInput) String() string

String returns the string representation

type DescribeLogGroupsOutput

type DescribeLogGroupsOutput struct {
	// A list of log groups.
	LogGroups []*LogGroup `locationName:"logGroups" type:"list"`

	// A string token used for pagination that points to the next page of results.
	// It must be a value obtained from the response of the previous request. The
	// token expires after 24 hours.
	NextToken *string `locationName:"nextToken" type:"string"`
	// contains filtered or unexported fields
}

func (DescribeLogGroupsOutput) GoString

func (s DescribeLogGroupsOutput) GoString() string

GoString returns the string representation

func (DescribeLogGroupsOutput) String

func (s DescribeLogGroupsOutput) String() string

String returns the string representation

type DescribeLogStreamsInput

type DescribeLogStreamsInput struct {
	// If set to true, results are returned in descending order. If you don't specify
	// a value or set it to false, results are returned in ascending order.
	Descending *bool `locationName:"descending" type:"boolean"`

	// The maximum number of items returned in the response. If you don't specify
	// a value, the request would return up to 50 items.
	Limit *int64 `locationName:"limit" type:"integer"`

	// The log group name for which log streams are to be listed.
	LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`

	// Will only return log streams that match the provided logStreamNamePrefix.
	// If you don't specify a value, no prefix filter is applied.
	LogStreamNamePrefix *string `locationName:"logStreamNamePrefix" type:"string"`

	// A string token used for pagination that points to the next page of results.
	// It must be a value obtained from the response of the previous DescribeLogStreams
	// request.
	NextToken *string `locationName:"nextToken" type:"string"`

	// Specifies what to order the returned log streams by. Valid arguments are
	// 'LogStreamName' or 'LastEventTime'. If you don't specify a value, results
	// are ordered by LogStreamName. If 'LastEventTime' is chosen, the request cannot
	// also contain a logStreamNamePrefix.
	OrderBy *string `locationName:"orderBy" type:"string" enum:"OrderBy"`
	// contains filtered or unexported fields
}

func (DescribeLogStreamsInput) GoString

func (s DescribeLogStreamsInput) GoString() string

GoString returns the string representation

func (DescribeLogStreamsInput) String

func (s DescribeLogStreamsInput) String() string

String returns the string representation

type DescribeLogStreamsOutput

type DescribeLogStreamsOutput struct {
	// A list of log streams.
	LogStreams []*LogStream `locationName:"logStreams" type:"list"`

	// A string token used for pagination that points to the next page of results.
	// It must be a value obtained from the response of the previous request. The
	// token expires after 24 hours.
	NextToken *string `locationName:"nextToken" type:"string"`
	// contains filtered or unexported fields
}

func (DescribeLogStreamsOutput) GoString

func (s DescribeLogStreamsOutput) GoString() string

GoString returns the string representation

func (DescribeLogStreamsOutput) String

func (s DescribeLogStreamsOutput) String() string

String returns the string representation

type DescribeMetricFiltersInput

type DescribeMetricFiltersInput struct {
	// Will only return metric filters that match the provided filterNamePrefix.
	// If you don't specify a value, no prefix filter is applied.
	FilterNamePrefix *string `locationName:"filterNamePrefix" type:"string"`

	// The maximum number of items returned in the response. If you don't specify
	// a value, the request would return up to 50 items.
	Limit *int64 `locationName:"limit" type:"integer"`

	// The log group name for which metric filters are to be listed.
	LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`

	// A string token used for pagination that points to the next page of results.
	// It must be a value obtained from the response of the previous DescribeMetricFilters
	// request.
	NextToken *string `locationName:"nextToken" type:"string"`
	// contains filtered or unexported fields
}

func (DescribeMetricFiltersInput) GoString

func (s DescribeMetricFiltersInput) GoString() string

GoString returns the string representation

func (DescribeMetricFiltersInput) String

String returns the string representation

type DescribeMetricFiltersOutput

type DescribeMetricFiltersOutput struct {
	MetricFilters []*MetricFilter `locationName:"metricFilters" type:"list"`

	// A string token used for pagination that points to the next page of results.
	// It must be a value obtained from the response of the previous request. The
	// token expires after 24 hours.
	NextToken *string `locationName:"nextToken" type:"string"`
	// contains filtered or unexported fields
}

func (DescribeMetricFiltersOutput) GoString

func (s DescribeMetricFiltersOutput) GoString() string

GoString returns the string representation

func (DescribeMetricFiltersOutput) String

String returns the string representation

type DescribeSubscriptionFiltersInput

type DescribeSubscriptionFiltersInput struct {
	// Will only return subscription filters that match the provided filterNamePrefix.
	// If you don't specify a value, no prefix filter is applied.
	FilterNamePrefix *string `locationName:"filterNamePrefix" type:"string"`

	// The maximum number of results to return.
	Limit *int64 `locationName:"limit" type:"integer"`

	// The log group name for which subscription filters are to be listed.
	LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`

	// A string token used for pagination that points to the next page of results.
	// It must be a value obtained from the response of the previous request. The
	// token expires after 24 hours.
	NextToken *string `locationName:"nextToken" type:"string"`
	// contains filtered or unexported fields
}

func (DescribeSubscriptionFiltersInput) GoString

GoString returns the string representation

func (DescribeSubscriptionFiltersInput) String

String returns the string representation

type DescribeSubscriptionFiltersOutput

type DescribeSubscriptionFiltersOutput struct {
	// A string token used for pagination that points to the next page of results.
	// It must be a value obtained from the response of the previous request. The
	// token expires after 24 hours.
	NextToken *string `locationName:"nextToken" type:"string"`

	SubscriptionFilters []*SubscriptionFilter `locationName:"subscriptionFilters" type:"list"`
	// contains filtered or unexported fields
}

func (DescribeSubscriptionFiltersOutput) GoString

GoString returns the string representation

func (DescribeSubscriptionFiltersOutput) String

String returns the string representation

type Destination

type Destination struct {
	AccessPolicy *string `locationName:"accessPolicy" type:"string"`

	Arn *string `locationName:"arn" type:"string"`

	// A point in time expressed as the number of milliseconds since Jan 1, 1970
	// 00:00:00 UTC.
	CreationTime *int64 `locationName:"creationTime" type:"long"`

	DestinationName *string `locationName:"destinationName" type:"string"`

	RoleArn *string `locationName:"roleArn" type:"string"`

	TargetArn *string `locationName:"targetArn" type:"string"`
	// contains filtered or unexported fields
}

func (Destination) GoString

func (s Destination) GoString() string

GoString returns the string representation

func (Destination) String

func (s Destination) String() string

String returns the string representation

type FilterLogEventsInput

type FilterLogEventsInput struct {
	// A unix timestamp indicating the end time of the range for the request. If
	// provided, events with a timestamp later than this time will not be returned.
	EndTime *int64 `locationName:"endTime" type:"long"`

	// A valid CloudWatch Logs filter pattern to use for filtering the response.
	// If not provided, all the events are matched.
	FilterPattern *string `locationName:"filterPattern" type:"string"`

	// If provided, the API will make a best effort to provide responses that contain
	// events from multiple log streams within the log group interleaved in a single
	// response. If not provided, all the matched log events in the first log stream
	// will be searched first, then those in the next log stream, etc.
	Interleaved *bool `locationName:"interleaved" type:"boolean"`

	// The maximum number of events to return in a page of results. Default is 10,000
	// events.
	Limit *int64 `locationName:"limit" type:"integer"`

	// The name of the log group to query.
	LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`

	// Optional list of log stream names within the specified log group to search.
	// Defaults to all the log streams in the log group.
	LogStreamNames []*string `locationName:"logStreamNames" type:"list"`

	// A pagination token obtained from a FilterLogEvents response to continue paginating
	// the FilterLogEvents results.
	NextToken *string `locationName:"nextToken" type:"string"`

	// A unix timestamp indicating the start time of the range for the request.
	// If provided, events with a timestamp prior to this time will not be returned.
	StartTime *int64 `locationName:"startTime" type:"long"`
	// contains filtered or unexported fields
}

func (FilterLogEventsInput) GoString

func (s FilterLogEventsInput) GoString() string

GoString returns the string representation

func (FilterLogEventsInput) String

func (s FilterLogEventsInput) String() string

String returns the string representation

type FilterLogEventsOutput

type FilterLogEventsOutput struct {
	// A list of FilteredLogEvent objects representing the matched events from the
	// request.
	Events []*FilteredLogEvent `locationName:"events" type:"list"`

	// A pagination token obtained from a FilterLogEvents response to continue paginating
	// the FilterLogEvents results.
	NextToken *string `locationName:"nextToken" type:"string"`

	// A list of SearchedLogStream objects indicating which log streams have been
	// searched in this request and whether each has been searched completely or
	// still has more to be paginated.
	SearchedLogStreams []*SearchedLogStream `locationName:"searchedLogStreams" type:"list"`
	// contains filtered or unexported fields
}

func (FilterLogEventsOutput) GoString

func (s FilterLogEventsOutput) GoString() string

GoString returns the string representation

func (FilterLogEventsOutput) String

func (s FilterLogEventsOutput) String() string

String returns the string representation

type FilteredLogEvent

type FilteredLogEvent struct {
	// A unique identifier for this event.
	EventId *string `locationName:"eventId" type:"string"`

	// A point in time expressed as the number of milliseconds since Jan 1, 1970
	// 00:00:00 UTC.
	IngestionTime *int64 `locationName:"ingestionTime" type:"long"`

	// The name of the log stream this event belongs to.
	LogStreamName *string `locationName:"logStreamName" type:"string"`

	// The data contained in the log event.
	Message *string `locationName:"message" type:"string"`

	// A point in time expressed as the number of milliseconds since Jan 1, 1970
	// 00:00:00 UTC.
	Timestamp *int64 `locationName:"timestamp" type:"long"`
	// contains filtered or unexported fields
}

Represents a matched event from a FilterLogEvents request.

func (FilteredLogEvent) GoString

func (s FilteredLogEvent) GoString() string

GoString returns the string representation

func (FilteredLogEvent) String

func (s FilteredLogEvent) String() string

String returns the string representation

type GetLogEventsInput

type GetLogEventsInput struct {
	// A point in time expressed as the number of milliseconds since Jan 1, 1970
	// 00:00:00 UTC.
	EndTime *int64 `locationName:"endTime" type:"long"`

	// The maximum number of log events returned in the response. If you don't specify
	// a value, the request would return as many log events as can fit in a response
	// size of 1MB, up to 10,000 log events.
	Limit *int64 `locationName:"limit" type:"integer"`

	// The name of the log group to query.
	LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`

	// The name of the log stream to query.
	LogStreamName *string `locationName:"logStreamName" type:"string" required:"true"`

	// A string token used for pagination that points to the next page of results.
	// It must be a value obtained from the nextForwardToken or nextBackwardToken
	// fields in the response of the previous GetLogEvents request.
	NextToken *string `locationName:"nextToken" type:"string"`

	// If set to true, the earliest log events would be returned first. The default
	// is false (the latest log events are returned first).
	StartFromHead *bool `locationName:"startFromHead" type:"boolean"`

	// A point in time expressed as the number of milliseconds since Jan 1, 1970
	// 00:00:00 UTC.
	StartTime *int64 `locationName:"startTime" type:"long"`
	// contains filtered or unexported fields
}

func (GetLogEventsInput) GoString

func (s GetLogEventsInput) GoString() string

GoString returns the string representation

func (GetLogEventsInput) String

func (s GetLogEventsInput) String() string

String returns the string representation

type GetLogEventsOutput

type GetLogEventsOutput struct {
	Events []*OutputLogEvent `locationName:"events" type:"list"`

	// A string token used for pagination that points to the next page of results.
	// It must be a value obtained from the response of the previous request. The
	// token expires after 24 hours.
	NextBackwardToken *string `locationName:"nextBackwardToken" type:"string"`

	// A string token used for pagination that points to the next page of results.
	// It must be a value obtained from the response of the previous request. The
	// token expires after 24 hours.
	NextForwardToken *string `locationName:"nextForwardToken" type:"string"`
	// contains filtered or unexported fields
}

func (GetLogEventsOutput) GoString

func (s GetLogEventsOutput) GoString() string

GoString returns the string representation

func (GetLogEventsOutput) String

func (s GetLogEventsOutput) String() string

String returns the string representation

type InputLogEvent

type InputLogEvent struct {
	Message *string `locationName:"message" type:"string" required:"true"`

	// A point in time expressed as the number of milliseconds since Jan 1, 1970
	// 00:00:00 UTC.
	Timestamp *int64 `locationName:"timestamp" type:"long" required:"true"`
	// contains filtered or unexported fields
}

A log event is a record of some activity that was recorded by the application or resource being monitored. The log event record that Amazon CloudWatch Logs understands contains two properties: the timestamp of when the event occurred, and the raw event message.

func (InputLogEvent) GoString

func (s InputLogEvent) GoString() string

GoString returns the string representation

func (InputLogEvent) String

func (s InputLogEvent) String() string

String returns the string representation

type LogGroup

type LogGroup struct {
	Arn *string `locationName:"arn" type:"string"`

	// A point in time expressed as the number of milliseconds since Jan 1, 1970
	// 00:00:00 UTC.
	CreationTime *int64 `locationName:"creationTime" type:"long"`

	LogGroupName *string `locationName:"logGroupName" type:"string"`

	// The number of metric filters associated with the log group.
	MetricFilterCount *int64 `locationName:"metricFilterCount" type:"integer"`

	// Specifies the number of days you want to retain log events in the specified
	// log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180,
	// 365, 400, 545, 731, 1827, 3653.
	RetentionInDays *int64 `locationName:"retentionInDays" type:"integer"`

	StoredBytes *int64 `locationName:"storedBytes" type:"long"`
	// contains filtered or unexported fields
}

func (LogGroup) GoString

func (s LogGroup) GoString() string

GoString returns the string representation

func (LogGroup) String

func (s LogGroup) String() string

String returns the string representation

type LogStream

type LogStream struct {
	Arn *string `locationName:"arn" type:"string"`

	// A point in time expressed as the number of milliseconds since Jan 1, 1970
	// 00:00:00 UTC.
	CreationTime *int64 `locationName:"creationTime" type:"long"`

	// A point in time expressed as the number of milliseconds since Jan 1, 1970
	// 00:00:00 UTC.
	FirstEventTimestamp *int64 `locationName:"firstEventTimestamp" type:"long"`

	// A point in time expressed as the number of milliseconds since Jan 1, 1970
	// 00:00:00 UTC.
	LastEventTimestamp *int64 `locationName:"lastEventTimestamp" type:"long"`

	// A point in time expressed as the number of milliseconds since Jan 1, 1970
	// 00:00:00 UTC.
	LastIngestionTime *int64 `locationName:"lastIngestionTime" type:"long"`

	LogStreamName *string `locationName:"logStreamName" type:"string"`

	StoredBytes *int64 `locationName:"storedBytes" type:"long"`

	// A string token used for making PutLogEvents requests. A sequenceToken can
	// only be used once, and PutLogEvents requests must include the sequenceToken
	// obtained from the response of the previous request.
	UploadSequenceToken *string `locationName:"uploadSequenceToken" type:"string"`
	// contains filtered or unexported fields
}

A log stream is sequence of log events from a single emitter of logs.

func (LogStream) GoString

func (s LogStream) GoString() string

GoString returns the string representation

func (LogStream) String

func (s LogStream) String() string

String returns the string representation

type MetricFilter

type MetricFilter struct {
	// A point in time expressed as the number of milliseconds since Jan 1, 1970
	// 00:00:00 UTC.
	CreationTime *int64 `locationName:"creationTime" type:"long"`

	// A name for a metric or subscription filter.
	FilterName *string `locationName:"filterName" type:"string"`

	// A symbolic description of how Amazon CloudWatch Logs should interpret the
	// data in each log event. For example, a log event may contain timestamps,
	// IP addresses, strings, and so on. You use the filter pattern to specify what
	// to look for in the log event message.
	FilterPattern *string `locationName:"filterPattern" type:"string"`

	MetricTransformations []*MetricTransformation `locationName:"metricTransformations" type:"list"`
	// contains filtered or unexported fields
}

Metric filters can be used to express how Amazon CloudWatch Logs would extract metric observations from ingested log events and transform them to metric data in a CloudWatch metric.

func (MetricFilter) GoString

func (s MetricFilter) GoString() string

GoString returns the string representation

func (MetricFilter) String

func (s MetricFilter) String() string

String returns the string representation

type MetricFilterMatchRecord

type MetricFilterMatchRecord struct {
	EventMessage *string `locationName:"eventMessage" type:"string"`

	EventNumber *int64 `locationName:"eventNumber" type:"long"`

	ExtractedValues map[string]*string `locationName:"extractedValues" type:"map"`
	// contains filtered or unexported fields
}

func (MetricFilterMatchRecord) GoString

func (s MetricFilterMatchRecord) GoString() string

GoString returns the string representation

func (MetricFilterMatchRecord) String

func (s MetricFilterMatchRecord) String() string

String returns the string representation

type MetricTransformation

type MetricTransformation struct {
	// The name of the CloudWatch metric to which the monitored log information
	// should be published. For example, you may publish to a metric called ErrorCount.
	MetricName *string `locationName:"metricName" type:"string" required:"true"`

	// The destination namespace of the new CloudWatch metric.
	MetricNamespace *string `locationName:"metricNamespace" type:"string" required:"true"`

	// What to publish to the metric. For example, if you're counting the occurrences
	// of a particular term like "Error", the value will be "1" for each occurrence.
	// If you're counting the bytes transferred the published value will be the
	// value in the log event.
	MetricValue *string `locationName:"metricValue" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (MetricTransformation) GoString

func (s MetricTransformation) GoString() string

GoString returns the string representation

func (MetricTransformation) String

func (s MetricTransformation) String() string

String returns the string representation

type OutputLogEvent

type OutputLogEvent struct {
	// A point in time expressed as the number of milliseconds since Jan 1, 1970
	// 00:00:00 UTC.
	IngestionTime *int64 `locationName:"ingestionTime" type:"long"`

	Message *string `locationName:"message" type:"string"`

	// A point in time expressed as the number of milliseconds since Jan 1, 1970
	// 00:00:00 UTC.
	Timestamp *int64 `locationName:"timestamp" type:"long"`
	// contains filtered or unexported fields
}

func (OutputLogEvent) GoString

func (s OutputLogEvent) GoString() string

GoString returns the string representation

func (OutputLogEvent) String

func (s OutputLogEvent) String() string

String returns the string representation

type PutDestinationInput

type PutDestinationInput struct {
	// A name for the destination.
	DestinationName *string `locationName:"destinationName" type:"string" required:"true"`

	// The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to
	// do Amazon Kinesis PutRecord requests on the desitnation stream.
	RoleArn *string `locationName:"roleArn" type:"string" required:"true"`

	// The ARN of an Amazon Kinesis stream to deliver matching log events to.
	TargetArn *string `locationName:"targetArn" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (PutDestinationInput) GoString

func (s PutDestinationInput) GoString() string

GoString returns the string representation

func (PutDestinationInput) String

func (s PutDestinationInput) String() string

String returns the string representation

type PutDestinationOutput

type PutDestinationOutput struct {
	Destination *Destination `locationName:"destination" type:"structure"`
	// contains filtered or unexported fields
}

func (PutDestinationOutput) GoString

func (s PutDestinationOutput) GoString() string

GoString returns the string representation

func (PutDestinationOutput) String

func (s PutDestinationOutput) String() string

String returns the string representation

type PutDestinationPolicyInput

type PutDestinationPolicyInput struct {
	// An IAM policy document that authorizes cross-account users to deliver their
	// log events to associated destination.
	AccessPolicy *string `locationName:"accessPolicy" type:"string" required:"true"`

	// A name for an existing destination.
	DestinationName *string `locationName:"destinationName" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (PutDestinationPolicyInput) GoString

func (s PutDestinationPolicyInput) GoString() string

GoString returns the string representation

func (PutDestinationPolicyInput) String

func (s PutDestinationPolicyInput) String() string

String returns the string representation

type PutDestinationPolicyOutput

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

func (PutDestinationPolicyOutput) GoString

func (s PutDestinationPolicyOutput) GoString() string

GoString returns the string representation

func (PutDestinationPolicyOutput) String

String returns the string representation

type PutLogEventsInput

type PutLogEventsInput struct {
	// A list of log events belonging to a log stream.
	LogEvents []*InputLogEvent `locationName:"logEvents" type:"list" required:"true"`

	// The name of the log group to put log events to.
	LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`

	// The name of the log stream to put log events to.
	LogStreamName *string `locationName:"logStreamName" type:"string" required:"true"`

	// A string token that must be obtained from the response of the previous PutLogEvents
	// request.
	SequenceToken *string `locationName:"sequenceToken" type:"string"`
	// contains filtered or unexported fields
}

func (PutLogEventsInput) GoString

func (s PutLogEventsInput) GoString() string

GoString returns the string representation

func (PutLogEventsInput) String

func (s PutLogEventsInput) String() string

String returns the string representation

type PutLogEventsOutput

type PutLogEventsOutput struct {
	// A string token used for making PutLogEvents requests. A sequenceToken can
	// only be used once, and PutLogEvents requests must include the sequenceToken
	// obtained from the response of the previous request.
	NextSequenceToken *string `locationName:"nextSequenceToken" type:"string"`

	RejectedLogEventsInfo *RejectedLogEventsInfo `locationName:"rejectedLogEventsInfo" type:"structure"`
	// contains filtered or unexported fields
}

func (PutLogEventsOutput) GoString

func (s PutLogEventsOutput) GoString() string

GoString returns the string representation

func (PutLogEventsOutput) String

func (s PutLogEventsOutput) String() string

String returns the string representation

type PutMetricFilterInput

type PutMetricFilterInput struct {
	// A name for the metric filter.
	FilterName *string `locationName:"filterName" type:"string" required:"true"`

	// A valid CloudWatch Logs filter pattern for extracting metric data out of
	// ingested log events.
	FilterPattern *string `locationName:"filterPattern" type:"string" required:"true"`

	// The name of the log group to associate the metric filter with.
	LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`

	// A collection of information needed to define how metric data gets emitted.
	MetricTransformations []*MetricTransformation `locationName:"metricTransformations" type:"list" required:"true"`
	// contains filtered or unexported fields
}

func (PutMetricFilterInput) GoString

func (s PutMetricFilterInput) GoString() string

GoString returns the string representation

func (PutMetricFilterInput) String

func (s PutMetricFilterInput) String() string

String returns the string representation

type PutMetricFilterOutput

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

func (PutMetricFilterOutput) GoString

func (s PutMetricFilterOutput) GoString() string

GoString returns the string representation

func (PutMetricFilterOutput) String

func (s PutMetricFilterOutput) String() string

String returns the string representation

type PutRetentionPolicyInput

type PutRetentionPolicyInput struct {
	// The name of the log group to associate the retention policy with.
	LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`

	// Specifies the number of days you want to retain log events in the specified
	// log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180,
	// 365, 400, 545, 731, 1827, 3653.
	RetentionInDays *int64 `locationName:"retentionInDays" type:"integer" required:"true"`
	// contains filtered or unexported fields
}

func (PutRetentionPolicyInput) GoString

func (s PutRetentionPolicyInput) GoString() string

GoString returns the string representation

func (PutRetentionPolicyInput) String

func (s PutRetentionPolicyInput) String() string

String returns the string representation

type PutRetentionPolicyOutput

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

func (PutRetentionPolicyOutput) GoString

func (s PutRetentionPolicyOutput) GoString() string

GoString returns the string representation

func (PutRetentionPolicyOutput) String

func (s PutRetentionPolicyOutput) String() string

String returns the string representation

type PutSubscriptionFilterInput

type PutSubscriptionFilterInput struct {
	// The ARN of the destination to deliver matching log events to. Currently,
	// the supported destinations are:   A Amazon Kinesis stream belonging to the
	// same account as the subscription filter, for same-account delivery.   A logical
	// destination (used via an ARN of Destination) belonging to a different account,
	// for cross-account delivery.
	DestinationArn *string `locationName:"destinationArn" type:"string" required:"true"`

	// A name for the subscription filter.
	FilterName *string `locationName:"filterName" type:"string" required:"true"`

	// A valid CloudWatch Logs filter pattern for subscribing to a filtered stream
	// of log events.
	FilterPattern *string `locationName:"filterPattern" type:"string" required:"true"`

	// The name of the log group to associate the subscription filter with.
	LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`

	// The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to
	// deliver ingested log events to the destination stream. You don't need to
	// provide the ARN when you are working with a logical destination (used via
	// an ARN of Destination) for cross-account delivery.
	RoleArn *string `locationName:"roleArn" type:"string"`
	// contains filtered or unexported fields
}

func (PutSubscriptionFilterInput) GoString

func (s PutSubscriptionFilterInput) GoString() string

GoString returns the string representation

func (PutSubscriptionFilterInput) String

String returns the string representation

type PutSubscriptionFilterOutput

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

func (PutSubscriptionFilterOutput) GoString

func (s PutSubscriptionFilterOutput) GoString() string

GoString returns the string representation

func (PutSubscriptionFilterOutput) String

String returns the string representation

type RejectedLogEventsInfo

type RejectedLogEventsInfo struct {
	ExpiredLogEventEndIndex *int64 `locationName:"expiredLogEventEndIndex" type:"integer"`

	TooNewLogEventStartIndex *int64 `locationName:"tooNewLogEventStartIndex" type:"integer"`

	TooOldLogEventEndIndex *int64 `locationName:"tooOldLogEventEndIndex" type:"integer"`
	// contains filtered or unexported fields
}

func (RejectedLogEventsInfo) GoString

func (s RejectedLogEventsInfo) GoString() string

GoString returns the string representation

func (RejectedLogEventsInfo) String

func (s RejectedLogEventsInfo) String() string

String returns the string representation

type SearchedLogStream

type SearchedLogStream struct {
	// The name of the log stream.
	LogStreamName *string `locationName:"logStreamName" type:"string"`

	// Indicates whether all the events in this log stream were searched or more
	// data exists to search by paginating further.
	SearchedCompletely *bool `locationName:"searchedCompletely" type:"boolean"`
	// contains filtered or unexported fields
}

An object indicating the search status of a log stream in a FilterLogEvents request.

func (SearchedLogStream) GoString

func (s SearchedLogStream) GoString() string

GoString returns the string representation

func (SearchedLogStream) String

func (s SearchedLogStream) String() string

String returns the string representation

type SubscriptionFilter

type SubscriptionFilter struct {
	// A point in time expressed as the number of milliseconds since Jan 1, 1970
	// 00:00:00 UTC.
	CreationTime *int64 `locationName:"creationTime" type:"long"`

	DestinationArn *string `locationName:"destinationArn" type:"string"`

	// A name for a metric or subscription filter.
	FilterName *string `locationName:"filterName" type:"string"`

	// A symbolic description of how Amazon CloudWatch Logs should interpret the
	// data in each log event. For example, a log event may contain timestamps,
	// IP addresses, strings, and so on. You use the filter pattern to specify what
	// to look for in the log event message.
	FilterPattern *string `locationName:"filterPattern" type:"string"`

	LogGroupName *string `locationName:"logGroupName" type:"string"`

	RoleArn *string `locationName:"roleArn" type:"string"`
	// contains filtered or unexported fields
}

func (SubscriptionFilter) GoString

func (s SubscriptionFilter) GoString() string

GoString returns the string representation

func (SubscriptionFilter) String

func (s SubscriptionFilter) String() string

String returns the string representation

type TestMetricFilterInput

type TestMetricFilterInput struct {
	// A symbolic description of how Amazon CloudWatch Logs should interpret the
	// data in each log event. For example, a log event may contain timestamps,
	// IP addresses, strings, and so on. You use the filter pattern to specify what
	// to look for in the log event message.
	FilterPattern *string `locationName:"filterPattern" type:"string" required:"true"`

	// A list of log event messages to test.
	LogEventMessages []*string `locationName:"logEventMessages" type:"list" required:"true"`
	// contains filtered or unexported fields
}

func (TestMetricFilterInput) GoString

func (s TestMetricFilterInput) GoString() string

GoString returns the string representation

func (TestMetricFilterInput) String

func (s TestMetricFilterInput) String() string

String returns the string representation

type TestMetricFilterOutput

type TestMetricFilterOutput struct {
	Matches []*MetricFilterMatchRecord `locationName:"matches" type:"list"`
	// contains filtered or unexported fields
}

func (TestMetricFilterOutput) GoString

func (s TestMetricFilterOutput) GoString() string

GoString returns the string representation

func (TestMetricFilterOutput) String

func (s TestMetricFilterOutput) String() string

String returns the string representation

Directories

Path Synopsis
Package cloudwatchlogsiface provides an interface for the Amazon CloudWatch Logs.
Package cloudwatchlogsiface provides an interface for the Amazon CloudWatch Logs.

Jump to

Keyboard shortcuts

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