@alertlogic/paws-collector
Alert Logic AWS based API Poll Log Collector Library
Last updated 17 days ago by autobuild-al .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @alertlogic/paws-collector 
SYNC missed versions from official npm registry.

paws-collector

Build Status ALPS build

Alert Logic AWS Based API Poll (PAWS) Log Collector Library.

Overview

This repository contains the AWS JavaScript Lambda function and CloudFormation Template (CFT) for deploying a log collector in AWS which will poll a 3rd party service API to collect and forward logs to the Alert Logic CloudInsight backend services.

Installation

Refer to the CF template readme for installation instructions.

How it works

Update Trigger

The Updater is a timer triggered function that runs a deployment sync operation every 12 hours in order to keep the collector lambda function up to date. The Updater syncs from the Alert Logic S3 bucket that contained the package used for the initial deployment.

Collection Trigger

The Collector function is an AWS lambda function which is triggered by SQS which contains a collection state message. During each invocation the function polls the specified 3rd party service log API and sends retrieved data to the AlertLogic Ingest service for further processing.

Checkin Trigger

The Checkin Scheduled Event trigger is used to report the health and status of the Alert Logic AWS lambda collector to the Azcollect back-end service based on an AWS Scheduled Event that occurs every 15 minutes.

Development

Creating New Collector Types

run npm run create-collector <<name>> <<version>> <<log-prefix>> to create a skeleton collector in the collectors folder.

Build

Clone this repository and build a lambda package by executing:

$ git clone https://github.com/alertlogic/paws-collector.git
$ cd paws-collector
$ make deps test package

Build collector for 3rd party API

Clone this repository and build a lambda package by executing:

$ git clone https://github.com/alertlogic/paws-collector.git
$ cd paws-collector/collectors/<collector-name>
$ make deps test package

The package name is al-<collector-name>-collector.zip

Debugging

To get a debug trace, set a Node.js environment variable called DEBUG and specify the JavaScript module/s to debug.

E.g.

export DEBUG=*
export DEBUG=index

Or set an environment variable called "DEBUG" in your AWS stack (using the AWS console) for a collector AWS Lambda function, with value "index" or "*".

See debug for further details.

Invoking locally

In order to invoke lambda locally please follow the instructions to install AWS SAM. AWS SAM uses the default credentials profile from ~/.aws/credentials.

  1. Encrypt the key using aws cli:
aws kms encrypt --key-id KMS_KEY_ID --plaintext AIMS_SECRET_KEY
  1. Include the encrypted token, and KmsKeyArn, used in Step 1, inside the SAM yaml:
    KmsKeyArn: arn:aws:kms:us-east-1:xxx:key/yyy
    Environment:
        Variables:
  1. Fill in environment variables in env.json (including encrypted AIMS secret key) and invoke locally:
cp ./local/env.json.tmpl ./local/env.json
vi ./local/env.json
make test
make sam-local
  1. Please see local/event.json for the event payload used for local invocation.

Current Tags

  • 1.3.3                                ...           latest (17 days ago)

30 Versions

  • 1.3.3                                ...           17 days ago
  • 1.3.2                                ...           24 days ago
  • 1.3.1                                ...           24 days ago
  • 1.3.0                                ...           a month ago
  • 1.2.0                                ...           2 months ago
  • 1.1.9                                ...           2 months ago
  • 1.1.8                                ...           2 months ago
  • 1.1.7                                ...           2 months ago
  • 1.1.6                                ...           3 months ago
  • 1.1.5                                ...           3 months ago
  • 1.1.4                                ...           3 months ago
  • 1.1.3                                ...           3 months ago
  • 1.1.2                                ...           3 months ago
  • 1.1.1                                ...           3 months ago
  • 1.1.0                                ...           3 months ago
  • 1.0.15                                ...           3 months ago
  • 1.0.14                                ...           4 months ago
  • 1.0.13                                ...           4 months ago
  • 1.0.12                                ...           4 months ago
  • 1.0.11                                ...           4 months ago
  • 1.0.10                                ...           5 months ago
  • 1.0.9                                ...           6 months ago
  • 1.0.8                                ...           6 months ago
  • 1.0.6                                ...           6 months ago
  • 1.0.5                                ...           6 months ago
  • 1.0.4                                ...           6 months ago
  • 1.0.3                                ...           6 months ago
  • 1.0.2                                ...           6 months ago
  • 1.0.1                                ...           6 months ago
  • 1.0.0                                ...           6 months ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 30
Last Month 148
Dependencies (5)
Dev Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |