publish-events-firehose
Publish event record on to firehose stream and store those records in a dedicated S3 bucket
Last updated 2 years ago by arun.neelakantam .
Original npm · Tarball · package.json
$ cnpm install publish-events-firehose 
SYNC missed versions from official npm registry.

JD Audit Service NodeJS SDK - README

This README would normally document whatever steps are necessary to get your application up and running.

Audit Service Nodejs SDK

  • This SDK can be integrated in NodeJS Projects.
  • Audit related data will be submitted to AWS Firehose stream.
  • 1.0.0

Setup

  • To install this package run the below command.
npm install publish-events-to-firehose
  • Create a directory named as log in the current directory to record the events data based on the request timeout.
$ mkdir log
var auditFirehose = require('publish-events-on-firehose')
var auditService = new auditFirehose.AuditService('STREAM-NAME', 'REGION', 'AWS-ACCOUNT-ACCESS-KEY', 'AWS-ACCOUNT-SECRET-KEY');
// You need to update the parameter with correct details in the above line.

var data = {
    "@version": "1.0",
    "@timestamp": "2018-04-12T11:22:53.955Z",
    "serviceID": "service id",
    "serviceNS": "service namespace",
    "operation": "READ",
    "objectType": "Customer",
    "objectID": "objectId",
    "authMechanism": "auth",
    "authID": "authid",
    "authToken": "authToken",
    "ipAddress": "1.1.1.1",
    "outcome": "success",
    "additionalData": {
        "metaData": {
            "url":
            "https://example.com/customers",
            "X-Env-Colour": "plum",
            "X-Git-Env": "da6b23985d0af2b24059748d19882d35e20f5658"
        },
        "rawData": [
            "Line 3Line 3Line 3Line 3Line 3Line 3Line 1"
        ]
    }
};

// Single record
auditService.putRecord(data).then(function(result) {
    console.log(result);
}, function (error) {
    console.log(error);
});

// Multiple records
auditService.putRecordBatch([data]).then(function (result) {
	console.log(result);
}, function (error) {
    console.log(error);
});

Components

The firehose delivery stream must be cretaed with S3 data backedup.

Current Tags

  • 1.0.0                                ...           latest (2 years ago)

1 Versions

  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (5)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |