【文件属性】:
文件名称:log2splunk:Splunk HTTP事件收集器(HEC)的记录器
文件大小:50KB
文件格式:ZIP
更新时间:2021-02-08 22:13:01
splunk logger splunk-hec http-event-collector TypeScript
log2splunk
登录到Splunk
用法
const Log2Splunk = require ( 'log2splunk' ) ;
const logger = new Log2Splunk ( {
token : "your-token" ,
host : "splunk-hec.example.com"
} ) ;
// Send string
logger . send ( "Hello World" ) ;
// Send json
logger . send ( {
message : "Hello World" ;
} ) ;
// Send with metadata
logger . send ( "Hello World" , {
source : 'my-app' ,
sourcetype : '_raw'
} )
// Send Raw
【文件预览】:
log2splunk-main
----.gitignore(4KB)
----.eslintrc(257B)
----package.json(2KB)
----package-lock.json(140KB)
----src()
--------index.ts(3KB)
----LICENSE(1KB)
----tsconfig.json(363B)
----.github()
--------workflows()
----README.md(6KB)
----tsconfig.production.json(130B)
----renovate.json(41B)
----test()
--------sendRaw.spec.ts(856B)
--------send.spec.ts(3KB)
----.editorconfig(292B)
----.prettierrc(51B)