Giter Site home page Giter Site logo

Comments (2)

reconbot avatar reconbot commented on July 19, 2024

I use pino-lambda in my nodejs project. It writes to stdout and could skip this patched console.log but it actually recreates the console log information as it is used by other tools for tracing. I have a JSON payload so I don't want to use the regex parser, but I do want to regex out the beginning of the line.

Currently the JSON parser errors like this

time="2021-07-10T01:21:08Z" level=warning msg="unable to parse line, skipping" error="invalid character '-' after top-level value" line="2021-07-10T01:21:00.854Z\tda58bd36-369b-40db-8199-8cdaa61d8630\tINFO\trequest\t{\"level\":30,\"time\":1625880060854,\"pid\":8,\"hostname\":\"xxxx\",\"module\":\"http:post-graphql\",\"awsRequestId\":\"da58bd36-369b-40db-8199-8cdaa61d8630\",\"apiRequestId\":\"xxxxx=\",\"x-correlation-trace-id\":\"Root=1-60e8f5fb-0bff75572f9d095e13bda637;Parent=40b3921a13d1f18b;Sampled=0\",\"x-correlation-id\":\"da58bd36-369b-40db-8199-8cdaa61d8630\",\"NODE_ENV\":\"staging\",\"functionName\":\"TelleyApiStaging-PostGraphqlHTTPLambda\",\"functionVersion\":\"$LATEST\",\"msg\":\"request\"}\r\n"

and the offending log line that I'd like to support looks like this (according to cloudwatch which parses the json, it's all one line)

2021-07-10T01:21:00.854Z	da58bd36-369b-40db-8199-8cdaa61d8630	INFO	request	
{
    "level": 30,
    "time": 1625880060854,
    "pid": 8,
    "hostname": "xxxx",
    "module": "http:post-graphql",
    "awsRequestId": "da58bd36-369b-40db-8199-8cdaa61d8630",
    "apiRequestId": "xxxxx=",
    "x-correlation-trace-id": "Root=1-60e8f5fb-0bff75572f9d095e13bda637;Parent=40b3921a13d1f18b;Sampled=0",
    "x-correlation-id": "da58bd36-369b-40db-8199-8cdaa61d8630",
    "NODE_ENV": "staging",
    "functionName": "TelleyApiStaging-PostGraphqlHTTPLambda",
    "functionVersion": "$LATEST",
    "msg": "request"
}

from agentless-integrations-for-aws.

dstrelau avatar dstrelau commented on July 19, 2024

Thank you for submitting this issue! In an effort to better respond to new issues, we're closing old, inactive issues like this one. If you feel this is still important to consider, please leave a comment.

from agentless-integrations-for-aws.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.