2.0.0 • Published 12 days ago

ma-push-to-logs v2.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
12 days ago

ma-push-to-logs

this package is for mobilearts to push logs to ElasticSearch and S3 using AWS-SDKV3

Functions

  • getLogsBody()
  • async pushLogs(logs_body)

Installation

Install the dependencies.

cd yourpath
npm i ma-push-to-logs

Usage

After installation add requirment to your code

const Logs = require("ma-push-to-logs");
const LogsServices = new Logs();

getLogsBody()

this function is to help you build your json, it will return an object with all available fields in logs as attributes. access the attributes you want and change their values.

var logs_body = LogsServices.getLogsBody();
logs_body.RelatedTo = 'LogsName';

async pushLogs(logs_body)

this function will first check the validity of the object by making sure all attributes are of matching type to that of logs, and then put in eventbridge bus that'll push logs to ES and S3.

var results = await pushLogs(logs_body)

Example:

const Logs = require('ma-push-to-logs');

async myFunction() {
  var logsServices = new Logs();
  var logs_body = LogsServices.getLogsBody();
  logs_body.RelatedTo = 'ExampleLog';
  logs_body.SourceResponse = 'ok';
  await LogsServices.pushLogs(logs_body);
};
1.2.4

12 days ago

2.0.0

12 days ago

1.2.0

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago