hepgen.js
Version:
HEP Message Generator
80 lines (75 loc) • 2.57 kB
JavaScript
// HEPGEN-JS SETTINGS (please configure)
// ------------------------------------------------------
var call_id = Math.random().toString(36).substring(7) + '@127.0.0.1';
var config = {
NAME: 'LOG Lines',
HEP_SERVER: '127.0.0.1',
HEP_PORT: 9060,
HEP_ID: '2001',
HEP_AUTH: 'myHep',
// the Messages to send
MESSAGES: [
{
// Session Log
rcinfo: {
type: 'HEP',
version: 3,
payload_type: 100,
captureId: '2001',
capturePass: 'myHep',
ip_family: 2,
protocol: 17,
proto_type: 100,
srcIp: '192.168.1.1',
dstIp: '192.168.1.2',
srcPort: 0,
dstPort: 0,
correlation_id: call_id
},
pause: 1000,
payload: 'SYSLOG: Processing OPTIONS request from nodejs using Call-Id: '+call_id
},
{
// Session Log
rcinfo: {
type: 'HEP',
version: 3,
payload_type: 100,
captureId: '2001',
capturePass: 'myHep',
ip_family: 2,
protocol: 17,
proto_type: 100,
srcIp: '192.168.1.1',
dstIp: '192.168.1.2',
srcPort: 0,
dstPort: 0,
correlation_id: call_id
},
pause: 1000,
payload: '{ "this": { "is": "a JSON object" }, "int": 1234 }'
},
{
rcinfo: {
type: 'API',
method: 'POST',
url: 'http://some.api/post',
port: 1234,
headers: {
'Content-Type': 'application/json'
}
},
pause: 0,
payload: {
"streams": [
{
"labels": "{type=\"json\"}",
"entries": [{ "ts": new Date().toISOString(), "line": "This is a cool log with Call-ID: "+call_id }]
}
]
}
}
]
};
// ------------------------------------------------------
module.exports = config;