log-to-csv
Log files Parser that takes the log files (often txt files) and insert them into some kind of pipe with regex of your implementation and returns a CSV format-like. The pipe will receive Line-By-Line, and will proccess it throught the regex syntax, and will move to the next line until finishing the InputStream.
What to do?
Implement ILineParser interface [TypeScript Recommended]
;
Install
npm i --save log-to-csv
Developer section
npm run build
Basic Usage
;; var app = 'input.txt' processstdout; app;
; /** * NotificationEventsParser Implementation example to fetch the relevant data in logs for `AndroidNotification` method * @author Islam Attrash */ implements ILineParser public regx:RegExp; public header:string; { //Recognize Notification States //Example: 2017-01-29 11:19:39.778 961-4981/? D/AndroidNotification: notifiy message:how are you?, packageName:com.ns.app1 thisregx = /.+AndroidNotification: notifiy message:,/; thisheader = `Date,Timestamp,NotificationMessage\n`; } /** * Get line relevant values * @returns ${dateString},${timestamp},$ */ { let values = thisregx; ifvalues === null return null; else let dateString = values1; let timestamp = dateString; let notifyMessage = values2; return `,,`; }
Live Demo (Parser in Examples folder)
- Takes Android logs and fetch some kind of method called AndroidNotification and shows the notification message