I am trying to apply @elastic/ecs-pino-format to nestjs-pino. Under the good nestjs-pino is using http-pino. I have noticed that http-pino adds the request object inside [Symbol(pino.chindings)] and I am assuming it's using a child logger.So I tried to write a custom formatter for extracting the req by calling obj.res.log.bindings() and putting at http.request to be compliant with Elastic Common Schema (ecs). The problem I face is now my log contains duplicate the req and the http.request and can't find a way to remove it. Not sure if I am looking in the wrong direction but I have found a lot of issues trying to make nestjs-pino print Elastic Common Schema (ecs) format logs. Also I have noticed issues where @elastic/ecs-pino-format can't handle fastify. Has anyone had similar issues ?
HTTP Pino logger and Elastic Common Schema (ecs) format in NestJS
2.6k Views Asked by Georgios Kampitakis At
1
There are 1 best solutions below
Related Questions in NODE.JS
- How to solve CERT_UNTRUSTED error in nodemailer
- Run a loop over a callback, node js
- Implementing prerender.io middleware in sails.js
- Token based authorization in nodejs/ExpressJs and Angular(Single Page Application)
- formatting path string in javascript
- One to One screensharing using WEBRTC
- Create polygon from grid (for collisions)
- Strange npm behavior when installing packages like grunt
- Convert JSON.gz to JSON in node js
- "Your npm version is outdated." but it's not. While install yo
- Why put methods on the prototype of a class instead of declaring them in the constructor?
- Node JS Async Response
- mongoose get property from nested schema after `group`
- Cannot Receive Incoming call on Twilio android Client
- How can I change a specific line in a file with node js?
Related Questions in NESTJS
- best practice for api data validation
- GraphQLError: Query root type must be provided
- How to express an union type in a GraphQL InputType
- Nestjs passport-facebook Invalid OAuth access token
- 'NestJS RabbitMQ Microservice'
- unable to read data from decoded token jwt verify
- nestjs firebase authentication
- How to send data from laravel to a redis queue implemented using Bull queue
- MongoParseError: Invalid message size: 1347703880, max allowed: 67108864 (NestJS & MongoDB Docker Container)
- aws-sdk in node app after deploying does not start
- How to use Global module in NestJs
- TypeORM: Select RANDOM() with a nested relation using QueryBuilder
- Nest js - httpservice add proxy
- Why does nestjs framework use a transport layer different than HTTP in a microservices approach?
- Restart the application when some file changes
Related Questions in ELK
- Need instruction : To Install ELK stack in On-Prem setup with persistant Volumes using Helm charts
- Connect MySQL through JDBC in filebeats in Elastic Cloud
- Docker Volume - Unhandled exception: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
- Looking for a way to add more information to Gatling transactions in the simulation.log file
- Python logging framework
- What do the Icons in Kibana fields mean?
- Logstash : Error: Could not find or load main class Stack when trying to run logstash.bat
- ELK data insertion fails due to type mapping failure because the actual data type changes
- Kibana unable to search message field
- Grok parse failure - while filtering error logs
- Reformate sources from elastic search
- Logstash stopped processing because of an error: (SystemExit) exit
- Mapping ElasticSearch apache module field
- Querying Nested Array in Elasticsearch
- How to configure Winlogbeat to connect to AWS elastisearch
Related Questions in PINOJS
- Differences between Pino Formatters and Serializers
- Mocking and modifying original function using native node mocking
- how can i rotate log files in pino.js logger
- Pino logger: how to keep log in dynamically created folders
- Node.js Pino logging - multistream vs transport
- Pino logger custom destinations based on log level and logging on nodeJS console
- How to rotate log files that generate with pino-multi-stream?
- Using pino api to add logs from different modules into 1 file
- Using pino api to add logs from different modules into file
- Can we add filter the req object generated by pinoLogger on express. Like it shows cookie in req object before its logged into the file using ddStream
- How to integrate adminjs with pino-http?
- How to integrate pino-http with AsyncLocalStorage?
- SIGINT, beforeExit and exit event handlers not called for ctrl-c keypress when application output is piped on
- How to use pino-transport in nodejs for logs.?
- Why node-emoji won't print properly on nestjs/pino logger?
Related Questions in ELASTIC-COMMON-SCHEMA
- Property not available for visualize in kibana
- What is the equivalent in ECS fields reference of Trace.CorrelationManager.ActivityId?
- How can I parse plain text log following ECS (elastic common schema) with logstash?
- How to translate Okta System Log records into Elastic Common Schema version 1.5 using logstash pipeline configuration
- Add trace.id and transaction.id Springboot
- Configure Filebeat hints-based Autodiscover with Elastic Common Schema
- How to find out if component templates are used in any index template via ElasticSearch API?
- Remove unnecessary objects from Elastic Common Schema logs
- HTTP Pino logger and Elastic Common Schema (ecs) format in NestJS
- Using Nlog logger with ECS layout, in kibana the json object appear as a string instead of multiple properties
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
So I was confused with
pinoandpino-httpand how they were integrated in nestjs-pino. From the looks of it @elastic/ecs-pino-format doesn't handle all the specifics for Elastic Common Schema (ecs) inpino-http. So what I ended up doing was passing innestjs-pinoas a configuration a merge of the format object from @elastic/ecs-pino-format and configuringpino-http.pino-httpsupports passingfor changing the keys of
reqandres. As for the data thatreqandrescontain,http-pinohas another option for transforming themFor more information about pino HTTP options.
Hope this helps anyone facing the same problem or want nestjs with Elastic Common Schema (ecs) logs.
An example configuration passed to
http-pinofor having ECS format.