Search for “id” and return all the relevant information

325
December 15, 2016, at 1:10 PM

I have a log file called test.log (for demo purposes - which I have simplified by a lot!) which looks like this:

2016-16-03 16:23:22,030 INFO [session] RESPONSE {api=GetSession, URL="http://testing/123ab-1234-abc/123ab-1234-abc.m3u8"}
2016-16-03 16:23:23,879 INFO [session] RESPONSE {api=KeepAlive, Ip=11.1.111.11, result=success}
2016-16-03 16:23:23,879 INFO [info] REQUEST {httpMethod=PUT,result=false}

I have a simple web UI which has an "ID" field, and a search button. So If the user searches for ID = 123-ab-123-abc

They front end UI will return this log event (as it contains the ID they are looking for):

2016-16-03 16:23:22,030 INFO [session] RESPONSE {api=GetSession, URL="http://testing/123ab-1234-abc/123ab-1234-abc.m3u8"}

This may seem like a simple concept, however I am not sure how to achieve this using Node.js - how do I search the log file and return the whole log event which contains that specific ID/string the user inputted?

I have tried:

  1. transforming the log file into a json object, however that did not work as some numbers would end up as string, and some parts of the log file would loose their values.

  2. Separating the log file into separate String values- as every event starts from a date - and then just returning the whoel string which contains the ID - however code wise I did not get far with this option

Any other ideas/ tips on how to achieve this?

Rent Charter Buses Company
READ ALSO
How to have a scheduled task running within an express server

How to have a scheduled task running within an express server

sorry the title isn't too clear I'm not really sure how to phrase what I'm asking for hereBut basically I'm creating a web app which is a list of public game servers

342
Upload a file from dart client to Node server

Upload a file from dart client to Node server

I'm stuck with this issue : I can't get my upload to work:

499
Failing to pass date from client to server and server to email

Failing to pass date from client to server and server to email

I am passing my array of date from client(angular) to server as follow

287
Socket.io view old messages

Socket.io view old messages

I've been reading on how to store messages on socketio,

375