How to use the splunk-sdk.ModularInputs function in splunk-sdk

To help you get started, we’ve selected a few splunk-sdk examples, based on popular ways it is used in public projects.

github microsoft / AzureMonitorAddonForSplunk / bin / app / checkpoints.js View on Github external
// to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all 
// copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
/* jshint unused: true */

var splunkjs = require("splunk-sdk");
var ModularInputs = splunkjs.ModularInputs;
var ModularInput = ModularInputs.ModularInput;
var Logger = ModularInputs.Logger;
var path = require('path');
var fs = require('fs');

exports.getCheckpoints = function (name) {

    var checkpointFileName = getCheckpointFileName(name);

    var checkpointsData = "{}";
    try {
        //Logger.debug(name, 'Reading contents of checkpoint file.');
        checkpointsData = fs.readFileSync(checkpointFileName, 'utf8');
    } catch (err) {
        if (err.code === 'ENOENT') { }
        else {
github microsoft / AzureMonitorAddonForSplunk / bin / app / azure_diagnostic_logs.js View on Github external
(function () {

    var splunkjs = require("splunk-sdk");
    var ModularInputs = splunkjs.ModularInputs;
    var logs = require('./azure_monitor_logs');

    exports.getScheme = function () {
        var schemeName = 'Azure Monitor Diagnostic Logs';
        var schemeDesc = 'Diagnostic Logs obtained via Azure Monitor.';

        return logs.getScheme(schemeName, schemeDesc);
    };

    // validateInput method validates the script's configuration (optional)
    exports.validateInput = function (definition, done) {
        done();
    };

    exports.streamEvents = function (name, singleInput, eventWriter, done) {
github splunk / splunk-sdk-javascript / examples / modularinputs / github_commits / bin / app / github_commits.js View on Github external
(function() {
    var fs              = require("fs");
    var path            = require("path");
    var GithubAPI       = require("github");
    var splunkjs        = require("splunk-sdk");
    var Async           = splunkjs.Async;
    var ModularInputs   = splunkjs.ModularInputs;
    var Logger          = ModularInputs.Logger;
    var Event           = ModularInputs.Event;
    var Scheme          = ModularInputs.Scheme;
    var Argument        = ModularInputs.Argument;
    var utils           = ModularInputs.utils;

    // The version number should be updated every time a new version of the JavaScript SDK is released.
    var SDK_UA_STRING = "splunk-sdk-javascript/1.9.0";

    // Create easy to read date format.
    function getDisplayDate(date) {
        var monthStrings = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];

        date = new Date(date);

        var hours = date.getHours();
github microsoft / AzureMonitorAddonForSplunk / bin / app / azure_monitor_logs.js View on Github external
// to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all 
// copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

/* jshint unused: true */

var splunkjs = require("splunk-sdk");
var ModularInputs = splunkjs.ModularInputs;
var ModularInput = ModularInputs.ModularInput;
var Logger = ModularInputs.Logger;
var Scheme = ModularInputs.Scheme;
var Event = ModularInputs.Event;
var Argument = ModularInputs.Argument;

var _ = require('underscore');
var AMQPClient = require('amqp10').Client;
var Policy = require('amqp10').Policy;
var Promise = require('bluebird');

var subs = require('./subs');
var strings = require('./strings');
strings.stringFormat();
var allHubs = require('./hubs.json');
var categories = require('./logCategories.json');
github microsoft / AzureMonitorAddonForSplunk / bin / app / azure_activity_log.js View on Github external
(function () {

    var splunkjs = require("splunk-sdk");
    var ModularInputs = splunkjs.ModularInputs;
    var logs = require('./azure_monitor_logs');

    exports.getScheme = function () {
        var schemeName = 'Azure Monitor Activity Log';
        var schemeDesc = 'Activity Log (aka Audit Log) obtained via Azure Monitor.';
        
        return logs.getScheme(schemeName, schemeDesc);
    };

    // validateInput method validates the script's configuration (optional)
    exports.validateInput = function (definition, done) {
        done();
    };

    // streamEvents streams the events to Splunk Enterprise
    exports.streamEvents = function (name, singleInput, eventWriter, done) {
github microsoft / AzureMonitorAddonForSplunk / test / launchamdl.js View on Github external
process.env.SPLUNK_DB = 'c:/github/SplunkAddonForAzureMonitorLogs';

var splunkjs = require("splunk-sdk");
var ModularInputs = splunkjs.ModularInputs;
var Logger = ModularInputs.Logger;

var _ = require('underscore');
var logs = require('./amdl');
var subs = require('./subs');
var strings = require('./strings');
strings.stringFormat();

singleInput = require('./singleInput.json');

var name = 'azure_diagnostic_logs://GOLIVE-Azure';

var messageHandler = function (data) {
    var dataAsString = JSON.stringify(data);

    if (dataAsString.length > 10000) {
github splunk / splunk-sdk-javascript / examples / modularinputs / random_numbers / bin / app / random_numbers.js View on Github external
(function() {
    var splunkjs        = require("splunk-sdk");
    var ModularInputs   = splunkjs.ModularInputs;
    var Logger          = ModularInputs.Logger;
    var Event           = ModularInputs.Event;
    var Scheme          = ModularInputs.Scheme;
    var Argument        = ModularInputs.Argument;
    var utils           = ModularInputs.utils;

    exports.getScheme = function() {
        var scheme = new Scheme("Random Numbers");

        scheme.description = "Streams events containing a random number.";
        scheme.useExternalValidation = true;
        scheme.useSingleInstance = true;

        scheme.args = [
            new Argument({
                name: "min",
github microsoft / AzureMonitorAddonForSplunk / bin / app / azureLogs.js View on Github external
(function () {
    var splunkjs = require("splunk-sdk");
    var ModularInputs = splunkjs.ModularInputs;
    var Logger = ModularInputs.Logger;
    var Event = ModularInputs.Event;
    var Scheme = ModularInputs.Scheme;
    var Argument = ModularInputs.Argument;

    var rp = require('request-promise');
    var _ = require('underscore');
    var AMQPClient = require('amqp10').Client;
    var Policy = require('amqp10').Policy;
    var Promise = require('bluebird');
    var adal = require('adal-node');
    var path = require('path');

    var subs = require('./subs');
    var config = require('./config.json');

splunk-sdk

SDK for usage with the Splunk REST API

Apache-2.0
Latest version published 3 days ago

Package Health Score

81 / 100
Full package analysis