search log files - 24/04/03 10:26 PM
i am trying to make a script to search log files. What i need is a way to search a monthly log for text, which i have done with:
right now that works ok, if someone types stats send *keeker*kicked*neoknight* , i have an ontext event that runs scanfile $nick %text and it searches the log file for the specified text, but what i WANT it to do is be able to search for the text and return the part of the log that contains it, not just the line, but like 15 lines before that and 15 lines after it.
like if i was searching for if someone was kicked and they didnt think they deserved it, an SOP could retrive that part of the log file, becaue if they retrived the whole log file, its like over 3 MB right now fo the month, thats a lot to send if the SOP has a 56k modem.
was wondering if there is a way to do something like this?
Code:
alias scanfile { var %svar $2- window -elk0 @test filter -fw $curlogfile @test *%svar* savebuf @test savedlogfilename.txt send $1 savedlogfilename.txt timerdelfile 1 40 remove savedlogfilename.txt }
right now that works ok, if someone types stats send *keeker*kicked*neoknight* , i have an ontext event that runs scanfile $nick %text and it searches the log file for the specified text, but what i WANT it to do is be able to search for the text and return the part of the log that contains it, not just the line, but like 15 lines before that and 15 lines after it.
like if i was searching for if someone was kicked and they didnt think they deserved it, an SOP could retrive that part of the log file, becaue if they retrived the whole log file, its like over 3 MB right now fo the month, thats a lot to send if the SOP has a 56k modem.
was wondering if there is a way to do something like this?