Skip to content

Examples: hepipe.js

Lorenzo Mangani edited this page Mar 25, 2016 · 4 revisions

HEPipe.js

HEP Enabled Log harvester for Node.js

HEPipe.js is a sipcapture tool to monitor files, extract and ship arbitrary rows (logs, events, cdrs, etc) with correlation_id to a HEP server such as HOMER or PCAPTURE using HEP Type 100

  • Status: Experimental

Install

git clone https://github.com/sipcapture/hepipe.js
cd hepipe.js
npm install

Configure

Edit application parameters for HEP and LOGS monitoring in config.js

Each LOGS item defines a log path and a (regex) rule to match/extract the proper correlation ID from rows


Example Log: NGCP/Kamailio

Let's take the following Kamailio logline containing a Call-ID (ID=) as example:

Nov 19 22:05:36 ams2 /usr/sbin/kamailio[1067]: INFO: Sending reply, fs='udp:127.0.0.1:5060' - ID=11876453@127.0.1.1
  • Regex Filter: ID=([^&]\\S*)
  • Correlation ID: 11876453@127.0.1.1

Resulting config.js:

var config = {
        
        // Address and Port of your HEP Server
        HEP_SERVER: 'homer.ip.addr',
        HEP_PORT: 9060,
        HEP_ID: '2001',
        HEP_AUTH: 'null',
        LOGS: [
                {
                  tag : 'ngcp', // unique id
                  host : '127.0.0.1', // host address
                  pattern: 'ID=([^&]\\S*)', // escaped regex
                  path : '/var/log/syslog' // path to logfile
                }
              ]
};

Start Hepipe-js

npm run forever

Example Logs in HOMER 5

For more information visit the hepipe.js repository.

Clone this wiki locally