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.
- 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
Two Methods:
- CLI Application
- As a Module
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
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
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
Searching clients by name: Manually overidden client names do not update in eventlog clientName, search by Mac for better results.
- Bottleneck
- Axios
- Inquirer (if using CLI)
MIT © Ben 2019