Splunk logging for JavaScript Requirements and Installation

This section of the documentation contains information about what you need to get started with Splunk logging for JavaScript:

Requirements

You need the following prerequisites to run Splunk logging for JavaScript.

Splunk Enterprise or Splunk Cloud

Splunk Enterprise 6.3.0 or later, or Splunk Cloud

Node.js

Node.js 0.10 or later

npm

The latest release of npm. To update npm to the latest version, run the following from the command line:

sudo npm install npm -g
Note: If you have questions or encounter trouble installing Node.js or npm, see Installing Node.js and updating npm on the npmjs website.

Bunyan (Optional)

To use the HTTP Event Collector stream for Bunyan, you must also have Bunyan. To install the latest version of Bunyan, enter the following on the command line:

npm install --save bunyan

HTTP Event Collector

In addition to the requirements listed above, you must do the following:

  • Enable HTTP Event Collector:
    • For Splunk Enterprise, go to Settings > Data inputs > HTTP Event Collector, and then click Global Settings. Click the Enable button, and then click Save. For more information, see "Enable HTTP Event Collector" in the Getting Data In manual.
    • For Splunk Cloud, submit a support ticket to have the feature enabled.
  • Create at least one HTTP Event Collector token: Go to Settings > Data inputs > HTTP Event Collector and click the New Token button. Proceed through the Add Data workflow until you've successfully created a token. For more information, see "Create an Event Collector token" in the Getting Data In manual.

Install Splunk logging for JavaScript

To install Splunk logging for JavaScript, run the following from the command line:

npm install --save splunk-logging

To install the HTTP Event Collector stream for Bunyan, run the following from the command line:

npm install --save splunk-bunyan-logger

Download Splunk logging for JavaScript

To download Splunk logging for JavaScript, including examples, click the following link:

To download the HTTP Event Collector Bunyan stream, click the following link: