Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

splunk-events

Package Overview
Dependencies
Maintainers
48
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

splunk-events - npm Package Compare versions

Comparing version 1.2.3 to 1.3.0-beta.0

2

package.json
{
"name": "splunk-events",
"version": "1.2.3",
"version": "1.3.0-beta.0",
"description": "Javascript lib to create Splunk Logs via HTTP",

@@ -5,0 +5,0 @@ "main": "SplunkEvents.js",

@@ -32,3 +32,3 @@ # Splunk Events

'WeaponConstruction',
'DeathStar'
'DeathStar',
{ username: 'vader'}

@@ -54,3 +54,3 @@ );

'WeaponConstruction',
'DeathStar'
'DeathStar',
{ username: 'vader'}

@@ -90,3 +90,3 @@ );

// Max time to wait until flush events. Requires 'autoFlush' option.
debounceMaxWait: 5000 //default
debounceMaxWait: 5000, //default

@@ -143,3 +143,3 @@ // Fetcher to do Splunk Events requests

By default this lib doesn't have any dependencies for the newer browsers (it tries to use Fetch API)
By default this lib doesn't have any dependencies for the newer browsers (it tries to use Fetch API).

@@ -192,3 +192,48 @@ But to make it work on old browsers and Node you must use axios (0.13+) as a dependency by installing it (```npm install --save axios```) and setting it on Splunk events config:

```
-------
### Using in VTEX IO (node app example)
Insert your splunk endpoint in your app policies (located at manifest.json) like so:
```json
{
"policies": [
{
"name": "outbound-access",
"attrs": {
"host": "YOUR_SPLUNK_ENDPOINT",
"path": "*"
}
}
]
}
```
If your endpoint has a port, you don't need to add it here. The protocol neither. Just the host...
Then you have to create a new fetcher or tweak your if you already have one.
This is to add headers so IO can properly proxy the request...
```javascript
function splunkCustomFetcher(context) {
const headers = context.headers || {}
return axios({
...context,
headers: {
...headers,
// this authtoken comes from your app's ColossusContext
'Proxy-Authorization': 'YOUR_AUTH_TOKEN',
// here you can proxy to https and add ports if you need to
'X-Vtex-Proxy-To': `https://${YOUR_SPLUNK_ENDPOINT}:8080`,
}
})
}
```
Finally you can configure your splunk cient like so:
```javascript
splunkEvents.config({
// add your endpoint with http protocol and no ports, let IO do the proxying, trust the headers...
endpoint: `http://${SPLUNK_ENDPOINT}`,
request: splunkCustomFetcher,
token: 'YOUR_TOKEN_HERE',
})
```
-------

@@ -195,0 +240,0 @@ ### Splunk Documentation

@@ -100,2 +100,3 @@ 'use strict';

host: _this.host,
time: +new Date(),
event: parsedEvent

@@ -102,0 +103,0 @@ };

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc