1 replies
Hi there,

I have a bunch of logs which I have a VB program which uploads to my PHP page as a POST query from an HTML page on the customer's PC.

So I have a heap of text results similar to below, and what I am wanting to do is to identify key data from the string.

Would you use RegEx, or simpler PHP sting handling functions?

Does anyone know of any log file analysis programs / APIs?

eg:

$testresults = explode(" ********", $rawtestresults);
echo $testresults[0]; //ping to local host
echo $testresults[1]; //ping to IP address


$rawtestresults will be a series of test like this below:

******** Testing ping to open DNS ... - OK! *******

Pinging 8.8.4.4 with 32 bytes of data:

Reply from 8.8.4.4: bytes=32 time=194ms TTL=53
Reply from 8.8.4.4: bytes=32 time=194ms TTL=53
Reply from 8.8.4.4: bytes=32 time=194ms TTL=53
Reply from 8.8.4.4: bytes=32 time=194ms TTL=53

Ping statistics for 8.8.4.4:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:
Minimum = 194ms, Maximum = 194ms, Average = 194ms
#analysis #string
  • Profile picture of the author Anthoni
    Originally Posted by JayBest View Post

    Hi there,
    Would you use RegEx, or simpler PHP sting handling functions?
    Depends on the amount of text you want to analyse and the speed it has to be done with. However, I would highly recommend RegEx for anything apart from simple strings.

    Take a look at stackoverflow.com they have some brilliant and complex RegEx strings to parse even the most complex data. If you ask nicely and show that you have tried yourself, generally you will get someone who will do it for you, just be polite

    Regards
    Anthoni
    {{ DiscussionBoard.errors[5321882].message }}

Trending Topics