This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> */ | |
/* Imports */ | |
/* <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> */ | |
const assert = require('assert'), | |
{ promisify } = require('util'), | |
{ Parser, processors } = require('xml2js'), | |
got = require('got'), | |
{ Cookie, CookieJar } = require('tough-cookie') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var got = require('got'); | |
/* -------------------CONFIGURATION-------------------------------------- */ | |
var API_KEY = '<api_key>'; //add as secure cred - Used to fetch data via GraphQL -- master account preferably | |
var INGEST_KEY = '<ingest_key>'; // add as a secure cred - Used to insert data into NRDB as metrics | |
var FACET = '<facet>'; //Attribute to facet ingest by | |
var excludedEventTypes = [ //eventTypes to ignore | |
"AuditLog", | |
"ActivityEvent", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
const axios = require('axios'); // promised based requests - like fetch() | |
function getCoffee() { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
}); | |
} |