filter

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package filter contains the app with methods to scan and retrieve logs from logGroup.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDataBoundariesStr

func CheckDataBoundariesStr(startdate, enddate string) (bool, error)

CheckDataBoundariesStr checks is startdate <= enddate

func CheckErr

func CheckErr(e error, errString string)

CheckErr checks if given error is not nil and exit program with signal 1

func CheckIfFileExistsHasContent added in v1.1.1

func CheckIfFileExistsHasContent(file string) (bool, error)

CheckIfFileExistsHasContent check if a specific file exists and is not empty

func GetLengthOfLogsFilesGenerated added in v1.1.0

func GetLengthOfLogsFilesGenerated(logsFileGenerated map[string][]string) (int, error)

GetLengthOfLogsFilesGenerated calculates the number of files on which search results have been stored

func ShortDateFromString

func ShortDateFromString(ds string) (time.Time, error)

ShortDateFromString parse shot date from string

Types

type App

type App struct{}

App contains the streamGroup to scan and the streamLogs to get from it

func (*App) FilterLogs

func (a *App) FilterLogs(options *Options) map[string][]string

FilterLogs creates a sessions of in aws and get all the logStreams for a specific logGroup

type Options

type Options struct {

	// Log group name on which all logStreams will be obtained and will apply the filtering
	LogGroup string

	// Aws profile to use for credentials in aws interaction
	AwsProfile string

	// Aws region to use for call operations to aws sdk
	AwsRegion string

	// Filter to apply on logStreams to retrieve eventLogs or not
	LogStreamFilter string

	// Position to apply log-stream-filter on logStreams of LogGroup (normally 1: logStreamPrefix, 2: service name, 3: service instance identifier)
	LogStreamFilterPosition int

	// Indicates if a specific term should be searched for in the logStreams
	SearchTermSearch bool

	// Term used to filter each of the messages found in the logStreams
	SearchTerm string

	// Path where to store the logs
	Path string

	// Filter only from a specific date
	StartDate string

	// Filter only until a specific date
	EndDate string
}

Options contains all the app possible options.

Jump to

Keyboard shortcuts

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