Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mhart/awslogger
A CLI tool to send lines from stdin to AWS CloudWatch Logs
https://github.com/mhart/awslogger
Last synced: 14 days ago
JSON representation
A CLI tool to send lines from stdin to AWS CloudWatch Logs
- Host: GitHub
- URL: https://github.com/mhart/awslogger
- Owner: mhart
- License: mit
- Created: 2015-06-04T20:26:27.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-04T20:30:00.000Z (over 9 years ago)
- Last Synced: 2024-10-12T05:23:02.121Z (about 1 month ago)
- Language: JavaScript
- Size: 117 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
awslogger
---------A CLI tool to send lines from stdin as messages to [AWS CloudWatch
Logs](http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/WhatIsCloudWatchLogs.html).Will create the log group and log stream if necessary (and if the correct
permissions are available). Loads credentials in the same way the AWS SDKs do
(env, config file, IAM role).Also check out
[cloudwatchlogs-stream](https://github.com/nearform/cloudwatchlogs-stream) in
case that's more suitable for your needs – it wasn't for mine because I needed
other features like line splitting, credential loading, timestamping etc.Example
-------```console
$ awslogger --helpUsage: awslogger [-t] group-name stream-name < lines.log
Sends lines from stdin to AWS CloudWatch Logs
Options:
--help Display this help message and exit
-t Prepend a ISO8601 timestamp to each message/line
```Or programmatically (as a writable stream):
```js
var awslogger = require('awslogger'),
CloudWatchLogsStream = awslogger.CloudWatchLogsStreamvar logStream = awslogger({logGroupName: 'a', logStreamName: 'b', addTimestamp: true})
// or
var logStream = new CloudWatchLogsStream({logGroupName: 'a', logStreamName: 'b', addTimestamp: true})
process.stdin.setEncoding('utf8')
process.stdin.pipe(logStream)
```Installation
------------With [npm](http://npmjs.org/) do:
```sh
$ npm install -g awslogger
```