Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
awslogs-stream
Advanced tools
#awslogs-stream
Stream to write logs to AWS CloudWatch.
This is actually a plain Node.js Writable object stream.
##Usage
var bunyan = require('bunyan');
var CloudWatchStream = require('awslogs-stream');
var stream = CloudWatchStream({
logGroupName: 'my-group',
logStreamName: 'my-stream',
cloudWatchLogsOptions: {
region: 'us-west-1'
},
processLogRecord: function(record) {
return {
message: JSON.stringify(record),
timestamp: 1*new Date(record.time)
}
}
});
var log = bunyan.createLogger({
name: 'foo',
streams: [
{
stream: stream,
type: 'raw'
}
]
});
##API
###CloudWatchStream(opts)
With opts
of:
logGroupName
(required)logStreamName
(required)cloudWatchLogsOptions
(optional): options passed to the AWS.CloudWatchLogs
constructorcloudWatchLogs
(optional): optional existing cloudwatchlogs clientprocessLogRecord
(optional): function to process log records to for cloudwatch (it should return object with 2 properties: message
to be string and timestamp
to be unix timestamp)bufferDuration
(optional, by default it is 5000 ms) timeout between writesbatchCount
(optional, by default 1000) after this number of records will be immediate send to cloud watchOn write of the first log, the module creates the logGroup and logStream if necessary.
We use the aws-sdk to write the logs - the AWS credentials have therefore to be configured using environment variables (AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
).
CloudWatchLogs.putLogEvents
is the method we use to write logs##Contributors This project was created by Mirko Kiefer (@mirkokiefer) and almost rewritten by Denis Bardadym.
FAQs
Writable stream to publish logs to AWS CloudWatch Logs
The npm package awslogs-stream receives a total of 4 weekly downloads. As such, awslogs-stream popularity was classified as not popular.
We found that awslogs-stream 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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.