func tokenAndPutWithRetry(event []*cloudwatchlogs.InputLogEvent, group string, stream string) error {
	seqtoken, err := token(group, stream)
	if err != nil {
		return err
	}
	err = putEvent(event, seqtoken, group, stream)
	if err != nil {
		//https://docs.aws.amazon.com/sdk-for-go/api/aws/awserr/#Error
		if aerr, ok := err.(awserr.Error); ok {
			if aerr.Code() == "InvalidSequenceTokenException" {
				glog.Infof("Catch InvalidSequenceTokenException, Retry With Newtoken")
				err = tokenAndPutWithRetry(event, group, stream)
			}
		}
	}
	return err
}
//sometimes scramble with other processes with `NextSequenceToken` and fail
sometimes scramble with other processes with `NextSequenceToken` and fail
// sometimes scramble with other processes with ` NextSequenceToken ` and fail
func tokenAndPutWithRetry(event []*cloudwatchlogs.InputLogEvent, group string, stream string) error {
	seqtoken, err := token(group, stream)
	if err != nil {
		return err
	}
	err = putEvent(event, seqtoken, group, stream)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			if aerr.Code() == "InvalidSequenceTokenException" {
				glog.Infof("Catch InvalidSequenceTokenException, Retry With Newtoken")
				err = tokenAndPutWithRetry(event, group, stream)
			}
		}
	}
	return err
}
func tokenAndPutWithRetry ( event [ ] * cloudwatchlogs . InputLogEvent , group string , stream string ) error { seqtoken , err := token ( group , stream ) if err != nil { return err } err = putEvent ( event , seqtoken , group , stream ) if err != nil { if aerr , ok := err . ( awserr . Error ) ; ok { if aerr . Code ( ) == " " { glog . Infof ( " " ) err = tokenAndPutWithRetry ( event , group , stream ) } } } return err }
sometimes scramble with other processes with `NextSequenceToken` and fail
sometimes scramble with other processes with ` NextSequenceToken ` and fail
//https://docs.aws.amazon.com/sdk-for-go/api/aws/awserr/#Error