Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"pulumi logs" entries only return first line #857

Closed
mmdriley opened this issue Jan 30, 2018 · 2 comments
Closed

"pulumi logs" entries only return first line #857

mmdriley opened this issue Jan 30, 2018 · 2 comments
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec
Milestone

Comments

@mmdriley
Copy link
Contributor

mmdriley commented Jan 30, 2018

$ pulumi logs
Collecting logs since 2018-01-29T22:11:20.000-08:00.

 2018-01-29T22:48:09.447-08:00[           example-api015d2b23] host:        8cqh69v23h.execute-api.us-west-2.amazonaws.com

but the actual log message had four lines:

$ aws logs filter-log-events --log-group-name '/aws/lambda/example-api015d2b23-cb4a8ca'
{
    "searchedLogStreams": [
        {
            "searchedCompletely": true, 
            "logStreamName": "2018/01/30/[$LATEST]13fe52dadf4f4f2d883ca224e9c788c0"
        }
    ], 
    "events": [
        {
            "ingestionTime": 1517294882774, 
            "timestamp": 1517294882747, 
            "message": "START RequestId: 840a5ca2-0589-11e8-af88-c5048a8b7b82 Version: $LATEST\n", 
            "eventId": "33836806571175245078059579401765461967659767013655576576", 
            "logStreamName": "2018/01/30/[$LATEST]13fe52dadf4f4f2d883ca224e9c788c0"
        }, 
        {
            "ingestionTime": 1517294889660, 
            "timestamp": 1517294889504, 
            "message": "2018-01-30T06:48:09.447Z\t840a5ca2-0589-11e8-af88-c5048a8b7b82\thost:        8cqh69v23h.execute-api.us-west-2.amazonaws.com\nregion:      us-west-2\naccount:     153052954103\nfunction:    example-api015d2b23-cb4a8ca\n\n", 
            "eventId": "33836806721861380384530999977446936393833612252905275392", 
            "logStreamName": "2018/01/30/[$LATEST]13fe52dadf4f4f2d883ca224e9c788c0"
        }, 
        {
            "ingestionTime": 1517294889660, 
            "timestamp": 1517294889504, 
            "message": "END RequestId: 840a5ca2-0589-11e8-af88-c5048a8b7b82\n", 
            "eventId": "33836806721861380384530999977446936393833612252905275393", 
            "logStreamName": "2018/01/30/[$LATEST]13fe52dadf4f4f2d883ca224e9c788c0"
        }, 
        {
            "ingestionTime": 1517294889660, 
            "timestamp": 1517294889504, 
            "message": "REPORT RequestId: 840a5ca2-0589-11e8-af88-c5048a8b7b82\tDuration: 6701.26 ms\tBilled Duration: 6800 ms \tMemory Size: 128 MB\tMax Memory Used: 39 MB\t\n", 
            "eventId": "33836806721861380384530999977446936393833612252905275394", 
            "logStreamName": "2018/01/30/[$LATEST]13fe52dadf4f4f2d883ca224e9c788c0"
        }
    ]
}

Need to turn on multiline mode in this regex:

logRegexp = regexp.MustCompile("^(.{23}Z)\t[a-g0-9\\-]{36}\t(.*)")

by adding (?s) to the capturing group

@mmdriley mmdriley added this to the 0.11 milestone Jan 30, 2018
@mmdriley mmdriley self-assigned this Jan 30, 2018
@mmdriley
Copy link
Contributor Author

Lambda logs (in Node.js at least) always have one trailing newline thanks to https://gist.github.com/mhart/4c84c567ecdec6bcec43#file-awslambda-js-L280

@joeduffy
Copy link
Member

If the fix is truly this simple, let's get it in M10.

@lindydonna lindydonna added the kind/bug Some behavior is incorrect or out of spec label Feb 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

3 participants