0

Hi guys i m trying to view a log file as a html file from my server , i m using one script which is here , so overall i m not a coder just trying to get it work

1.
because log file latest entries are at bottom and it becomes too big after some time, so i was thinking to make something which will show last entries on top ( easy to read ) and it will show only latest 50 entries ( means last 50 entries )

2.
and i need some regular expressions to match and replace URL into link for following types

http://www.somesite.org/details.php?id=52148
[ http://www.somesite.org/details.php?id=52148 ]
(http://www.somesite.org/details.php?id=52148)

want to remove the whole line depends on word2

[word1] something-line-text [word2] some text again

-----
want to replace some text with another depends on word2

[word1] something-line-text [word2] some text again

into

REPLCACEDTEXT something-line-text some text again

thanks for help

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by saiprem
0

for the first question to retrieve the data of the log file, there is a command available in linux. You can use that in your php code using any of these functions system, passthru, exec...

The command is something like

tail -f 'your_path_of_logfile'

for more details on tail check
tail --help in linux prompt

I didn't get what we have to do exactly

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.