You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# The Splunk Enterprise Software Development Kit for JavaScript
3
3
4
-
#### Version 1.11.0
4
+
#### Version 1.12.0
5
5
6
6
The Splunk Enterprise Software Development Kit (SDK) for JavaScript contains library code and examples designed to enable developers to build applications using the Splunk platform and JavaScript. This SDK supports server-side and client-side JavaScript.
7
7
@@ -13,9 +13,9 @@ For more information, see [Splunk Enterprise SDK for JavaScript](https://dev.spl
13
13
14
14
The Splunk Enterprise SDK for JavaScript was tested with Node.js v8.17.0, v14.
15
15
16
-
* Splunk Enterprise 8.0 or 8.2, or Splunk Cloud
16
+
* Splunk Enterprise 9.0 or 8.2, or Splunk Cloud
17
17
18
-
The Splunk Enterprise SDK for JavaScript was tested with Splunk Enterprise 8.0 or 8.2, or Splunk Cloud.
18
+
The Splunk Enterprise SDK for JavaScript was tested with Splunk Enterprise 9.0 or 8.2, or Splunk Cloud.
19
19
20
20
* Splunk Enterprise SDK for JavaScript
21
21
@@ -124,7 +124,7 @@ var serviceWithSessionKey = new splunkjs.Service(
124
124
host:'localhost',
125
125
port:'8089',
126
126
sessionKey:SESSION_KEY, // Add your sessionKey here
127
-
version:'8',
127
+
version:'9.0',
128
128
});
129
129
130
130
serviceWithSessionKey.get("search/jobs", { count:1 }, function (err, res) {
Support for modular inputs is removed from Splunk Enterprise SDK for JavaScript and we recommand to use [Splunk Enterprise SDK for Python](https://github.com/splunk/splunk-sdk-python) for the modular inputs. See the [Python SDK modular inputs example](https://github.com/splunk/splunk-app-examples/tree/master/modularinputs/python) and [PythonSDK modular inputs docs](https://dev.splunk.com/enterprise/docs/devtools/python/sdk-python/howtousesplunkpython/howtocreatemodpy) for reference.
182
+
180
183
## SDK examples
181
184
182
-
The Splunk Enterprise SDK for JavaScript contains several server- and client-based examples.
185
+
The Splunk Enterprise SDK for JavaScript contains several server- and client-based examples, which are located in the [Splunk App Example repo](https://github.com/splunk/splunk-app-examples).
183
186
For details, see the [Splunk Enterprise SDK for JavaScript Examples](https://dev.splunk.com/enterprise/docs/devtools/javascript/sdk-javascript/sdkjavascriptexamples) on the Splunk Developer Portal.
184
187
185
-
####Create a .splunkrc convenience file
188
+
## Create a .splunkrc convenience file
186
189
187
-
To connect to Splunk Enterprise, many of the SDK examples and unit tests take command-line arguments that specify values for the host, port, and login credentials for Splunk Enterprise. For convenience during development, you can store these arguments as key-value pairs in a text file named **.splunkrc**. Then, the SDK examples and unit tests use the values from the **.splunkrc** file when you don't specify them.
190
+
To connect to Splunk Enterprise, many of the SDK unit tests take command-line arguments that specify values for the host, port, and login credentials for Splunk Enterprise. For convenience during development, you can store these arguments as key-value pairs in a text file named **.splunkrc**. Then, the SDK unit tests use the values from the **.splunkrc** file when you don't specify them.
188
191
189
192
>**Note**: Storing login credentials in the **.splunkrc** file is only for convenience during development. This file isn't part of the Splunk platform and shouldn't be used for storing user credentials for production. And, if you're at all concerned about the security of your credentials, enter them at the command line rather than saving them in this file.
190
193
@@ -201,7 +204,7 @@ To use this convenience file, create a text file with the following format:
201
204
# Access scheme (default: https)
202
205
scheme=https
203
206
# Your version of Splunk Enterprise
204
-
version=8.2
207
+
version=9.0
205
208
206
209
Save the file as **.splunkrc** in the current user's home directory.
207
210
@@ -246,37 +249,6 @@ function (err) {
246
249
});
247
250
```
248
251
249
-
### Client-side examples
250
-
251
-
The Splunk Enterprise SDK for JavaScript includes several browser-based examples, which you can run from the Examples web page.
252
-
253
-
To start a simple web server and open the Examples page in a web browser, enter:
254
-
255
-
node sdkdo examples
256
-
257
-
### Node.js examples
258
-
259
-
The Splunk Enterprise SDK for JavaScript includes several command-line examples, which are located in the **/splunk-sdk-javascript/examples/node** directory. These examples run with Node.js and use the command-line arguments from the **.splunkrc** file, if you set this up with your login credentials.
260
-
261
-
For example, to run the **jobs.js** example, open a command prompt in the **/splunk-sdk-javascript/examples/node** directory and enter:
262
-
263
-
node jobs.js list
264
-
265
-
If you aren't storing your login credentials in **.splunkrc**, enter the following command, providing your own values:
266
-
267
-
node jobs.js --username yourusername --password yourpassword list
268
-
269
-
Your output should look something like this:
270
-
271
-
~\splunk-sdk-javascript\examples\node> node .\jobs.js list
0 commit comments