Installations
npm install @mondomob/winston-splunk-httplogger
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>=8.0
Node Version
14.16.0
NPM Version
6.14.11
Score
65.5
Supply Chain
89.9
Quality
78.1
Maintenance
50
Vulnerability
97.6
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
adrianhall
Download Statistics
Total Downloads
1,284
Last Day
1
Last Week
4
Last Month
13
Last Year
429
GitHub Statistics
15 Stars
155 Commits
22 Forks
5 Watching
1 Branches
8 Contributors
Bundle Size
737.07 kB
Minified
195.37 kB
Minified + Gzipped
Package Meta Information
Latest Version
2.4.0
Package Id
@mondomob/winston-splunk-httplogger@2.4.0
Unpacked Size
20.34 kB
Size
5.62 kB
File Count
9
NPM Version
6.14.11
Node Version
14.16.0
Total Downloads
Cumulative downloads
Total Downloads
1,284
Last day
-50%
1
Compared to previous day
Last week
-33.3%
4
Compared to previous week
Last month
85.7%
13
Compared to previous month
Last year
217.8%
429
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
winston-splunk-httplogger
A Winston transport for logging to Splunk with a HTTP Event Collector.
Compatibility
Winston >= 3.0.0
is required for winston-splunk-httplogger
>= 2.0.0
. Please use version 1.2.2
for legacy Winston support.
Installation
1npm install --save winston winston-splunk-httplogger
Usage
1var winston = require('winston'), 2 SplunkStreamEvent = require('winston-splunk-httplogger'); 3 4var splunkSettings = { 5 token: process.env.SPLUNK_TOKEN, 6 host: process.env.SPLUNK_HOST || 'localhost' 7}; 8 9// Now use winston as normal 10var logger = new winston.Logger({ 11 transports: [ 12 new winston.transports.Console(), 13 new SplunkStreamEvent({ splunk: splunkSettings }) 14 ] 15}); 16 17logger.info('This is sent to Splunk');
API
splunkTransport = new SplunkStreamEvent(config);
Create a new instance of SplunkStreamEvent
. Takes the following configuration:
- config: configuration settings for the
SplunkStreamEvent
instance - config.splunk: the
Splunk Logger
settings - config.splunk.token: the Splunk HTTP Event Collector token
- [config.level=info]: logging level to use, will show up as the
severity
field of an event - [config.splunk.index=winston-index]: the index for the events sent to Splunk
- [config.splunk.source=winston]: the source for the events sent to Splunk
- [config.splunk.sourcetype=winston-splunk-logger]: the sourcetype for the events sent to Splunk
- [config.splunk.host=localhost]: the Splunk HTTP Event Collector host
- [config.splunk.maxRetries=0]: how many times to retry the splunk logger
- [config.splunk.port=8088]: the Splunk HTTP Event Collector port
- [config.splunk.path=/services/collector/event/1.0]: URL path to use
- [config.splunk.protocol=https]: the protocol to use
- [config.splunk.url]: URL string to pass to
url.parse
. This will try to sethost
,path
,protocol
,port
,url
. Any of these values will be overwritten if the corresponding property is set onconfig
- [config.splunk.eventFormatter]: formats events, returning an event as a
string,
function(message, severity)
- [config.batchInterval=0]: automatically flush events after this many milliseconds. When set to a non-positive value, events will be sent one by one. This setting is ignored when non-positive
- [config.maxBatchSize=0]: automatically flush events after the size of queued events exceeds this many bytes. This setting is ignored when non-positive
- [config.maxBatchCount=1]: automatically flush events after this many events have been queued. Defaults to flush immediately on sending an event. This setting is ignored when non-positive
- [config.exitOnError=true]: whether an unexpected request error causes the javascript process to exit. Defaults to
true
.
Configuring Splunk
- Log into your Splunk instance as an Administrator
- Go to Settings > Data Inputs
- Click on HTTP Event Collector under Local inputs
- Click on New Token
- Walk through the wizard to configure your new HTTP Event Collector
Splunk will provide you with a token at the end of the wizard. You need to insert that token into the splunk object you use to create the SplunkStreamEvent() object. In the example above, this is done by placing the token in the SPLUNK_TOKEN environment variable.
See Also
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
SAST tool detected but not run on all commits
Details
- Info: SAST configuration detected: CodeQL
- Warn: 0 commits out of 28 are checked with a SAST tool
Reason
security policy file detected
Details
- Info: security policy file detected: SECURITY.md:1
- Warn: no linked content found
- Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1
- Info: Found text in security policy: SECURITY.md:1
Reason
project is archived
Details
- Warn: Repository is archived.
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/adrianhall/winston-splunk-httplogger/codeql-analysis.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/adrianhall/winston-splunk-httplogger/codeql-analysis.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/adrianhall/winston-splunk-httplogger/codeql-analysis.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/adrianhall/winston-splunk-httplogger/codeql-analysis.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull-request.yaml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/adrianhall/winston-splunk-httplogger/pull-request.yaml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull-request.yaml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/adrianhall/winston-splunk-httplogger/pull-request.yaml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/adrianhall/winston-splunk-httplogger/release.yaml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/adrianhall/winston-splunk-httplogger/release.yaml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/adrianhall/winston-splunk-httplogger/release.yaml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/adrianhall/winston-splunk-httplogger/release.yaml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/pull-request.yaml:20
- Warn: npmCommand not pinned by hash: .github/workflows/release.yaml:21
- Warn: npmCommand not pinned by hash: .github/workflows/release.yaml:38
- Info: 0 out of 10 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 3 npmCommand dependencies pinned
Reason
Found 0/2 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29
- Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28
- Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1
- Warn: no topLevel permission defined: .github/workflows/pull-request.yaml:1
- Warn: no topLevel permission defined: .github/workflows/release.yaml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
11 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
Score
3.2
/10
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More