Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
pino-cloudwatch
Advanced tools
pino-cloudwatch
is a simple pino transport that buffers and holds pino logs until one of the following conditions are met:
The log group name is specified via the CLI (--prefix
) and the log stream name is built based on the following information:
prefix
,os.hostname()
),process.id
),# ./bin/pino-cloudwatch.js
Sends pino logs to AWS CloudWatch Logs.
Usage: node index.js | pino-cloudwatch [options]
Options:
--help Show help [boolean]
--version Show version number [boolean]
--aws_access_key_id AWS Access Key ID
--aws_secret_access_key AWS Secret Access Key
--aws_region AWS Region
--group AWS CloudWatch log group name [required]
--prefix AWS CloudWatch log stream name prefix
--stream AWS CloudWatch log stream name, overrides --prefix option.
--interval The maxmimum interval (in ms) before flushing the log
queue. [default: 1000]
group
: String
(required)prefix
: String
interval
: Integer
(default 1000
ms, 0
to disable)The interval
is the amount of time in ms that must elapse before attempting to send logs to CloudWatch Logs. Increase this to reduce the number of calls to CloudWatch Logs.
If you set this to 0
then it will only send logs when:
note: Disabling the interval could mean that logs will never be sent to CloudWatch Logs.
aws_access_key_id
: String
aws_secret_access_key
: String
aws_region
: String
This module can be required and used as a writable stream:
var pump = require('pump');
var split = require('split2');
var pinoCloudWatch = require('pino-cloudwatch');
pump(process.stdin, split(), pinoCloudWatch({ group: 'test' }));
Since pino-cloudwatch returns a writable stream, you can attach event handlers like any other writeable stream (see https://nodejs.org/dist/v10.19.0/docs/api/stream.html#stream_writable_streams).
In addition, a flushed
event is emitted once the logs are successfully pushed / saved in AWS CloudWatch Logs.
var pump = require('pump');
var split = require('split2');
var pinoCloudWatch = require('pino-cloudwatch');
var streamToCloudWatch = pinoCloudWatch({ group: 'test' });
streamToCloudWatch.on('flushed', function () {
console.log('Logs were successfully sent to AWS CloudWatch');
});
pump(process.stdin, split(), pinoCloudWatch({ group: 'test' }));
Technically pino-cloudwatch
can send any object mode stream to CloudWatch Logs. This includes any text-based log file. For example: tailing a standard log file like nginx access.log.
# npm test
FAQs
CloudWatch Logs transport for pino
The npm package pino-cloudwatch receives a total of 1,033 weekly downloads. As such, pino-cloudwatch popularity was classified as popular.
We found that pino-cloudwatch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.