O'Reilly logo

Splunk Essentials - Second Edition by Erickson Delgado, Betsy Page Sigman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required