GithubHelp home page GithubHelp logo

midlandsci / event-log-fetch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from benbenbenbenbenbenbenbenbenben/event-log-fetch

0.0 1.0 0.0 21 KB

Return JSON of Meraki Dashboard event logs between start time and end times.

License: MIT License

JavaScript 100.00%

event-log-fetch's Introduction

Cisco Meraki - Event Log Fetcher

Return JSON of Meraki Dashboard event logs between start time and end time. Iterates backwards from end time event until start time event. Option to use CLI and save JSON and CSV file.

Features

  • Nodejs application
  • Queue system for API calls, automatic retries on 400/500 errors
  • CLI to select organization, network, device type, start and end times and option to select a specific client
  • Save to JSON and CSV files

CLI Demo


Installation

Two Methods:

  • CLI Application
  • As a Module

CLI Application

Clone the source locally:

$ git clone https://github.com/benbenbenbenbenbenbenbenbenben/event-log-fetch.git
$ cd event-log-fetch

Install npm and nodejs:

$ sudo apt-get install npm nodejs

Install project dependencies:

$ npm install

Add your Meraki api key to src/utils/config.js

Run application:

$ node src/app.js

Module

Clone the source locally:

$ git clone https://github.com/benbenbenbenbenbenbenbenbenben/event-log-fetch.git
$ cd event-log-fetch

Install project dependencies:

$ npm install bottleneck axios

Required files:

utils/events.js
utils/dashboard.js
utils/queue.js

See src/example.js for basic use case:

From your script require the events.js file:

const events = require('./utils/events')

If using async for function call:

async function call() {
    let result = await events.events(networkID, apiKey, params)
    //Do whatever with the result
    console.log(result)
}

Must include parameters as below:

let params = {
    productType: 'appliance',
    start: '2019-12-10T12:26:01.526Z',
    endingBefore: '2019-12-10T15:26:02.587Z'
  }

See full list of parameters available: https://developer.cisco.com/meraki/api/#/rest/api-endpoints/events/get-network-events

Run example file:

$ node src/example.js

Notes

Searching clients by name: Manually overidden client names do not update in eventlog clientName, search by Mac for better results.

Dependencies

  • Bottleneck
  • Axios
  • Inquirer (if using CLI)

License

MIT © Ben 2019

event-log-fetch's People

Contributors

benbenbenbenbenbenbenbenbenben avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.