1.0.14 • Published 5 months ago

@adobe/spacecat-shared-splunk-client v1.0.14

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 months ago

Spacecat Shared - Splunk Client

A JavaScript client for the Splunk API, part of the SpaceCat Shared library. It allows you to query Splunk for useful patterns in CDN logs worth flagging to customers, including error pages delivered with a 200 status code which are a content request reduction (and therefore cost savings) opportunity.

The Splunk API requires first authenticating (see https://docs.splunk.com/Documentation/Splunk/9.4.0/RESTREF/RESTaccess#auth.2Flogin) then issuing a query using a session ID and cookie from the authentication response (see https://docs.splunk.com/Documentation/Splunk/9.4.0/RESTREF/RESTsearch#search.2Fjobs).

The corporate Splunk instance requires corporate network connectivity. Additional configuration is required for the service to work. The unit tests can run locally without being on the corporate network.

Installation

Install the package using npm:

npm install @adobe/spacecat-shared-splunk-client

Usage

Constructor

import SplunkAPIClient, { fetch } from '@adobe/spacecat-shared-splunk-client';

const config = {
  apiBaseUrl: 'SPLUNK_API_BASE_URL>',
  apiUser: 'SPLUNK_API_USER',
  apiPass: 'SPLUNK_API_PASS',
};

const client = new SplunkAPIClient(config, fetch);

Creating and instance from Helix UniversalContext

const context = {}; // Your AWS Lambda context object
const client = SplunkAPIClient.createFrom(context);

Testing

To run tests:

npm run test

Linting

Lint your code:

npm run lint

Cleaning

To remove node_modules and package-lock.json:

npm run clean

Additional Information

1.0.14

5 months ago

1.0.13

5 months ago

1.0.12

5 months ago

1.0.11

5 months ago

1.0.10

5 months ago

1.0.9

6 months ago

1.0.8

6 months ago

1.0.7

6 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago