Creating the final dashboard\jobs.js
Here is the final jobs.js
file we will use. Copy this block of code and overwrite the current jobs.js
file. We will break this down into functions later and try to explain what the coding does, without putting too much emphasis on the Node.js code itself.
Note
WARNING
When copying from PDF and other files, the encoding may be different, such that it breaks the apostrophes and quotation marks. If you encounter this, just search and replace all apostrophes ('
) and quotation marks ("
).
var CronJob = require('cron').CronJob var splunkjs = require('splunk-sdk') var fs = require('fs') new CronJob('*/30 * * * * *', function() { // fetch the saved searchName fetchSavedSearch(renderResults, 'sdk_status_codes') }, function() ...
Get Splunk Essentials - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.