This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

How to convert log file names & Pisg setup

General support and discussion of Eggdrop bots.
Post Reply
n
ndrp
Voice
Posts: 9
Joined: Thu Jun 06, 2013 5:39 am

How to convert log file names & Pisg setup

Post by ndrp »

1)

In Eggdrop I have used the default log format:
set logfile-suffix ".%d%b%Y"

I have about 1800 log files per channel.

Pisg does not recognize right order of log files. If I use for example 8 last log files Pisg outputs:

Code: Select all

1839 logfile(s) found, parsing the last 8, using eggdrop format...

Analyzing log /home/myuser/eggdrop/logs/mychannel.log.31May2013... 1 days, 89 lines total
Analyzing log /home/myuser/eggdrop/logs/mychannel.log.31May2014... 2 days, 301 lines total
Analyzing log /home/myuser/eggdrop/logs/mychannel.log.31Oct2010... 3 days, 345 lines total
Analyzing log /home/myuser/eggdrop/logs/mychannel.log.31Oct2011... 4 days, 676 lines total
Analyzing log /home/myuser/eggdrop/logs/mychannel.log.31Oct2012... 5 days, 964 lines total
Analyzing log /home/myuser/eggdrop/logs/mychannel.log.31Oct2013... 6 days, 1192 lines total
Analyzing log /home/myuser/eggdrop/logs/mychannel.log.31Oct2014... 7 days, 1746 lines total
Analyzing log /home/myuser/eggdrop/logs/mychannel.log.yesterday... 9 days, 1888 lines total
Channel analyzed successfully in 00 hours, 00 minutes and 04 seconds on Mon Dec 29 16:20:54 2014
Pisg wants the log file name format to be
set logfile-suffix ".%Y%m%d".

How can I convert my old logfiles to right format? My scripting skills are limited.

I have used only 8 log files for testing because reading all 1800 files is slow.


Here is my pisg.cfg:

Code: Select all

<channel="#mychannel">
   LogDir="/home/myuser/eggdrop/logs/"
   LogPrefix = "mychannel"
   NFiles="8"
   Format="eggdrop"
   Network="IRCNet"
   OutputFile="/home/myuser/public_html/stats/index.html"
   Lang = "FI"
   Maintainer="myuser"

 </channel>

#<set ColorScheme="orange_grey">
<set ShowWpl="1">
<set WordHistory="20">
<set NickTracking="1">
<set ShowMostActiveByHour="1">
<set TopicHistory="5">
<set NickHistory="10">
<set DailyActivity="31">
<set ShowWords="1">
2)
I copied all png files from /usr/share/pisg/gfx to /home/myuser/public_html/stats/. Do I need to copy css files from /usr/share/pisg/layout to somewhere?

3)
Is "logfile smjpk #mychannel "logs/mychannel.log" " enough for Pisg or do i need to add for example o flag?
n
ndrp
Voice
Posts: 9
Joined: Thu Jun 06, 2013 5:39 am

Post by ndrp »

I got some help. I converted filenames from mychannel.log.31May2013 to mychannel.log.20130531 by this script:

Code: Select all

#!/bin/bash
find . -type f -name '*.log.*[^0-9-]*' -print0 | while read -d '' -r logfile; do
    mv "${logfile}"  "${logfile/.log.*/.log.`date -d ${logfile#*.log.} +%Y%m%d`}"
done
Post Reply