npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

splunkdev-grunt

v0.1.9

Published

Grunt tasks for building Splunk applications.

Downloads

20

Readme

splunkdev-grunt

Grunt tasks for building Splunk applications.

Getting Started

This plugin requires Grunt ~0.4.1

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install splunkdev-grunt --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('splunkdev-grunt');

List of tasks

Grunt "splunk-services" task

This task allow you to manipulate Splunk services.

Requirements

This task expects configuration:

grunt.config.init({
  splunk: {
    splunkHome: '/path/to/Splunk/home/folder',
    splunkd: {
      username: 'admin',
      password: 'splunkd_password',
      scheme: 'https',
      host: 'localhost',
      port: '8089',
      version: '6.0'
    }
  }
});

If you have splunk-cli installed - you can run splunk-cli config to save configuration for specific Splunk instance and load it with next code snipped:

grunt.config.init({
  splunk: require('splunkdev-grunt/lib/configuration').get()
});

Available task options

  • splunk-services:reload-apps - reload application configurations
  • splunk-services:*:start - start all Splunk services
  • splunk-services:*:stop - stop all Splunk services
  • splunk-services:*:restart - restart all Splunk services
  • splunk-services:splunkweb:start - start splunkweb service
  • splunk-services:splunkweb:stop - stop splunkweb service
  • splunk-services:splunkweb:restart - restart splunkweb service
  • splunk-services:splunkd:start - start splunkd service
  • splunk-services:splunkd:stop - stop splunkd service
  • splunk-services:splunkd:restart - restart splunkd service

Grunt "splunk-watch" task

Task watches for changes under Splunk home folder and do required steps, like call livereload or reload Splunk app configurations or restart required Splunk services.

Requirements

This task depends on "splunk-contrib-watch" task.

Available task options

  • splunk-watch:apps:* - watch for all Splunk applications
  • splunk-watch:apps:[appname] - watch for specific application [appname]
  • splunk-watch:splunk - watch for changes in Splunk (core components)
  • splunk-watch:* - watch for all applications and core components

Notes

Implementation of task "splunk-watch" configure and launch grunt task "grunt-contrib-watch". If you need to use "grunt-contrib-watch" at the same time as you use "splunk-watch" - you will need to use lib/watchConfig module and just launch "watch" task from "grunt-contrib-watch". For example:


var splunkWatchConfig = require('splunkdev-grunt/lib/watchConfig');

var watchConfig = { /* ... your watch configuration ... */ };
// If you need to watch for application changes
splunkWatchConfig.watchForApp(watchConfig, 'application_name');
// If you need to watch for core Splunk components
splunkWatchConfig.watchForSplunk(watchConfig);

// Configure grunt
grunt.config.init({
  watch: watchConfig
});

// Use watch task by default
grunt.registerTask('default', ['watch']);

Grunt "splunk-pack" task

Pack application into tar.gz archive for uploading to the store

Usage

grunt.config.init({
  splunk: {
    pack: {
      sourceDir: __dirname,
      output: path.join(__dirname, 'myapp.tar.gz'),
      source: [
        '**/*',
        '!*.tar.gz'
      ]
    }
  }
});

Other useful hidden API

Module "splunkdev-grunt/lib/environment"

Function "splunkHome"

Helps to discover current Splunk home directory. It checks first for SPLUNK_HOME environment variable, after that checks if current working directory is subfolder of Splunk folder.

var splunkHome = require('splunkdev-grunt/lib/environment').splunkHome();

Module "splunkdev-grunt/lib/apps"

Function "getCurrentApp"

Gets current application if current working directory is under one of the applications in Splunk apps directory.

var currentApp = require('splunkdev-grunt/lib/apps').getCurrentApp();
if (!currentApp) {
  var applicationName = currentApp.name();
  var pathToApplication = currentApp.path();
}

Release History

(Nothing yet)