in reply to Re: IRC log search
in thread IRC log search

In goes one or several search terms, perhaps sometimes constrained to the recent n months or so. Out comes the day and the line number where someone mentioned all the terms. With those data I can look up the immediate context from the log file.

Currently I'm not treating the nickname which is in front of each line different than the spoken words. This means a nickname can be given as additional search term to restrict results to what a certain person said.

Is that enough to make a schema?

Yes, good pointers. I looked at DBI, that's straightforward, but I don't understand Class::DBI on a conceptual level. Still reading the mysql guide.

Replies are listed 'Best First'.
Re^3: IRC log search
by FitTrend (Pilgrim) on Feb 22, 2005 at 13:59 UTC

    Based on what I know, I would say the schema should be minimally:

    id, int(11) auto_increment
    nickname, varchar 100
    message, text
    timestamp, int(11)
    dateStamp, time/date

    Some would argue that you don't need 2 timestamp fields. However in my experience, I sometimes have the need to search base on an EPOCH time range (timestamp) or to use MySQLs date system to search between certain dates.

    My logic for this database is:

    • You can limit queries base on nickname
    • You can limit queries base on time range
    • You can perform certain matches based on text
    • Use a combination of any/all three

    I've included an ID field. This field exists based on common database practices and for future growth. I feel that you may need to code a sub or script to parse a raw log to insert it into the database properly. It may get tricky depending on how the IRC formats the time stamp in the logs.

    Hope this helps