 |
|
 |
|
|
Author |
Message |
Blipie
Joined: 23 May 2006 Posts: 5
|
Posted: Tue May 23, 2006 1:36 am Post subject: How to make a new pattern? |
|
|
I am new to attendance administering. Having trouble figuring out EQDKP, don't laugh. Am looking at using this tool to make admining EQDKP easier. We are looking to at starting a Vanguard guild when it comes out. Although we are a voice based guild and want to actually track our attendance off of the vent chat logs. I was looking at pattern examples but I am not a coder and have no idea what I'm looking at. I have a sample log file. Does anyone know how I would modifiy this?
20060522 18:53:18 RCON: ID 474, 'Bilbo' issued 'status'
status
UID CID PING
* 466 495 65 Bilbo IP Logged
471 495 75 Vermin IP Logged
* 474 5 60 Painkiller IP Logged
475 5 98 Agriba IP Logged
* 478 495 72 Vicror IP Logged
479 495 25 Tabby IP Logged
It will record one of these at start and end of raids as well as every hour during the raids. The first numbers are year 2006 month 05 day 22 with the hour : min : second that the log was taken and rest of line meaningless. Then what is important there is the CID column which would basically be a Zone. Thoes numbers change. At this time 495 would be the raid channel and 5 as the afks. Only thoes in 495 would get credit. After that is the IP address of each person which is irrilivant. Can DKPLP be made to work with this?
Blipie
| Description: |
|
 Download |
| Filename: |
testlog.txt |
| Filesize: |
470 Bytes |
| Downloaded: |
374 Time(s) |
|
|
Back to top |
|
 |
Lokorin Site Admin
Joined: 03 Apr 2006 Posts: 697
|
Posted: Tue May 23, 2006 1:47 pm Post subject: |
|
|
It should be possible to use DKP Log Parser for this, however the log has to modified a bit first so that the time is displayed on every line. The easiest way to do it would probably be to first send the log through a simple converter and then send it on to DKP Log Parser. If I get the time I will make such a converter later today along with the needed patterns.
If possible a longer sample log would be nice for testing purposes, especially if it has plenty of noise in it. That makes it easier to check that the converter or parser doesn't accidentally trigger or something that it should not trigger on.
|
|
Back to top |
|
 |
Lokorin Site Admin
Joined: 03 Apr 2006 Posts: 697
|
Posted: Tue May 23, 2006 5:42 pm Post subject: |
|
|
A temporary converter for Ventrilo logs has been uploaded. The corresponding patterns and settings are:
Settings
Parse mode: Classic
Input type: Text
Parsed times are in UTC: False
Patterns and formats (In the "Parse patterns" tab in the "Classic" subtab)
Log member pattern
| Code: |
| (\d{4})(\d{2})(\d{2}) (\d{2}):(\d{2}):(\d{2}) \*?\s+\d+\s+495\s+\d+\s+(\w+) |
Log member format
| Code: |
| $1|$2|$3|$4|$5|$6|$7 |
Once those settings are entered you should just have to visit the converter, enter your log, copy the resulting log, enter that log into DKP Log Parser and it should parse it correctly. The member pattern currently only triggers on people in CID 495, I'm not sure if that's how you wanted it. If you can record more things than just participation in that log then please feel free to post some samples of that too and support will be added to the converter and patterns.
Additionally a suggestion has been added that should remove the need for you to manually use the converter in the future.
*edit*
If anyone would prefer to set up their own converter (to e.g. tailor it to their custom needs) then this is the short bit of code currently used.
| Code: |
$lines = array_diff(explode("\n", stripslashes($form->getValue('log'))), array("", "\r"));
$logFound = false; $logStarted = false;
foreach($lines as $line) {
if($logFound) {
if(preg_match("/\*?\s+\d+\s+\d+\s+\d+\s+\w+.+/", $line)) {
//We found a status log, convert it.
echo $matches[1].' '.$matches[2].' '.$line;
$logStarted = true;
} else if($logStarted) {
//The log has ended.
$logStarted = $logFound = false;
}
} else if(preg_match(
"/(\d{8})\s(\d{2}:\d{2}:\d{2}).+issued 'status'/", $line, $matches)) {
//We have found a status log.
$logFound = true;
}
}
|
*another edit* - Updated the code.
Last edited by Lokorin on Tue May 23, 2006 8:12 pm; edited 1 time in total |
|
Back to top |
|
 |
Blipie
Joined: 23 May 2006 Posts: 5
|
Posted: Tue May 23, 2006 6:33 pm Post subject: |
|
|
More logs from today. Not raiding right now so kinda not much tere but all the patterns are there. The date needs to go from the issued status line to the user names kinda like the one posted. But when it finds the next status which is what shows who's on in what channels (which will be done by an officer every hour) it needs to put the appropriate time for each status on the previous lines? Not sure.....
495 is currently the lobby. Every time the hosting company restarts the server thought the channel number can change unfortunatly. It doesn't ahppen often like maybe once a month. People in other channels are irrilivant their ether in groups or in the AFK channel etc. Only one channel will be used for raiding. I could paste a line in to the beginning start of each log that would define what current raid channel is if that would work better?
monitor 1
20060523 08:17:14 RCON: ID 497, 'BlipBox' issued 'status'
status
UID CID PING
* 497 495 65 BlipBox IPAddress
* 498 495 65 Blip IPAddress
Connections 2/25
20060523 09:01:25 MSG_CONN: ID 499, IP IPAddress, Accepted. (16384,223232) (87380,223232)
20060523 09:01:25 MSG_ABORT: ID 499, IPAddress aborted.
20060523 09:15:41 MSG_CONN: ID 500, IP IPAddress, Accepted. (16384,223232) (87380,223232)
20060523 09:15:42 LOGON: ID 500, IP IPAddress, Kronic
20060523 09:42:49 NET: ID 500, Disconnect, 104.
20060523 09:42:49 MSG_DISC: ID 500, From=3357168, To=9740052, Sec=1628, Name=Kronic
20060523 10:00:35 MSG_CONN: ID 501, IP IPAddress, Accepted. (16384,223232) (87380,223232)
20060523 10:00:35 MSG_ABORT: ID 501, IPAddress aborted.
20060523 10:04:41 MSG_CONN: ID 502, IP IPAddress, Accepted. (16384,223232) (87380,223232)
20060523 10:04:41 LOGON: ID 502, IP IPAddress, Airiayanna
20060523 10:44:22 NET: ID 502, Disconnect, 104.
20060523 10:44:22 MSG_DISC: ID 502, From=7696522, To=3936777, Sec=2381, Name=Airiayanna
20060523 11:47:50 MSG_CONN: ID 503, IP IPAddress, Accepted. (16384,223232) (87380,223232)
20060523 11:47:50 LOGON: ID 503, IP IPAddress, Taifu, (AUTOADMIN)
20060523 12:04:58 MSG_CONN: ID 504, IP IPAddress, Accepted. (16384,223232) (87380,223232)
20060523 12:04:58 LOGON: ID 504, IP IPAddress, Kikina
20060523 12:16:19 RCON: ID 497, 'BlipBox' issued 'status'
status
UID CID PING
* 497 495 67 BlipBox IPAddress
* 498 495 72 Blip IPAddress
* 503 495 72 Taifu IPAddress
504 495 114 Kikina IPAddress
Connections 4/25
20060523 12:18:52 NET: ID 503, Disconnect, 104.
20060523 12:18:52 MSG_DISC: ID 503, From=1807632, To=3906842, Sec=1862, Name=Taifu
Blip
| Description: |
|
 Download |
| Filename: |
testlog.txt |
| Filesize: |
1.87 KB |
| Downloaded: |
478 Time(s) |
| Description: |
|
 Download |
| Filename: |
testlog.txt |
| Filesize: |
1.87 KB |
| Downloaded: |
151 Time(s) |
|
|
Back to top |
|
 |
Lokorin Site Admin
Joined: 03 Apr 2006 Posts: 697
|
Posted: Tue May 23, 2006 7:38 pm Post subject: |
|
|
| Blipie wrote: |
| More logs from today. |
Thanks, the converter was a bit off but has now been corrected. It now updates the time correctly when new status output starts.
| Quote: |
| 495 is currently the lobby. Every time the hosting company restarts the server thought the channel number can change unfortunatly. It doesn't ahppen often like maybe once a month. |
The simplest way to handle that would probably be for you to update the pattern with the new channel number. If you look at the log member pattern posted above you will see that it contains "495", just change that to the new channel number whenever it changes.
|
|
Back to top |
|
 |
Nomad_Wanderer
Joined: 04 Apr 2006 Posts: 30
|
Posted: Tue May 23, 2006 8:04 pm Post subject: |
|
|
The quickness at which this was setup and used demonstrates the power of this program..
BRAVO!
|
|
Back to top |
|
 |
Blipie
Joined: 23 May 2006 Posts: 5
|
Posted: Tue May 23, 2006 8:54 pm Post subject: |
|
|
I am just utterly amazed. That is just awesome Thank you a ton!! Now you said that was a temporary converter. How can I get one setup or hosted someplace. I have site setup for my guild. It's using php like the forums is that a PHP script that I could use some where?
Blip
|
|
Back to top |
|
 |
Lokorin Site Admin
Joined: 03 Apr 2006 Posts: 697
|
Posted: Tue May 23, 2006 9:27 pm Post subject: |
|
|
The converter will remain where it is until an alternative is introduced. The following is the uploaded script in it's entirety.
| Code: |
<?php
/*
* Lokorin.com
* Copyright 2004-2006
* Licensed under the GNU LGPL. See COPYING for full terms.
*/
/**
* A simple converter for ventrilo logs so that they can be used in DKP Log
* Parser.
* @author Andreas Launila
* @version $Revision: 1.2 $
* @package com.lokorin.lokorin.public
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
*/
/**
* For access to common constants and functions.
*/
require_once('_includes/common.php');
doInclude('lib_forms');
Page::getInstance()->setTitle('Ventrilo log converter');
//Construct the form.
$form = new Form('Enter the log to convert');
$form->addField(new TextArea('log', true, 16, 60), 'Log');
$form->addField(new SubmitButton('submit', 'Convert'));
//Generate the output.
if($form->isValid()) {
echo '<pre>';
$lines = array_diff(explode("\n", stripslashes($form->getValue('log'))), array("", "\r"));
$logFound = false; $logStarted = false;
foreach($lines as $line) {
if($logFound) {
if(preg_match("/\*?\s+\d+\s+\d+\s+\d+\s+\w+.+/", $line)) {
//We found a status log, convert it.
echo $matches[1].' '.$matches[2].' '.$line;
$logStarted = true;
} else if($logStarted) {
//The log has ended.
$logStarted = $logFound = false;
}
} else if(preg_match(
"/(\d{8})\s(\d{2}:\d{2}:\d{2}).+issued 'status'/", $line, $matches)) {
//We have found a status log.
$logFound = true;
}
}
echo '</pre>';
} else {
echo $form->getForm();
}
Page::getInstance()->display();
?> |
It uses some libraries to create the form and so on. While you could grab the needed libraries from the source I assume that you want a standalone version. The following should work without any extra libraries.
| Code: |
<html>
<head><title>Ventrilo log converter</title></head>
<body>
<h1>Ventrilo log converter</h1>
<?php
if(!isset($_POST['log'])) {
?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post"><fieldset>
<legend>Enter the log to convert</legend>
<textarea name="log" cols="60" rows="16"></textarea>
<br /><input class="submitButton" type="submit" name="submit" value="Convert" />
</fieldset></form>
<?php
} else {
echo '<pre>';
$lines = array_diff(explode("\n", stripslashes($_POST['log'])),
array("", "\r"));
$logFound = false; $logStarted = false;
foreach($lines as $line) {
if($logFound) {
if(preg_match("/\*?\s+\d+\s+\d+\s+\d+\s+\w+.+/", $line)) {
//We found a status log, convert it.
echo $matches[1].' '.$matches[2].' '.$line;
$logStarted = true;
} else if($logStarted) {
//The log has ended.
$logStarted = $logFound = false;
}
} else if(preg_match("/(\d{8})\s(\d{2}:\d{2}:\d{2}).+issued 'status'/",
$line, $matches)) {
//We have found a status log.
$logFound = true;
}
}
echo '</pre>';
}
?>
</body>
</html> |
Just paste that into a file, name it something that ends with ".php" and upload it to your server. If it does not work then please tell me and I will take a look.
|
|
Back to top |
|
 |
Blipie
Joined: 23 May 2006 Posts: 5
|
Posted: Tue May 23, 2006 10:33 pm Post subject: |
|
|
Will it matter if the "*" is there or not? I'm doing a test install of EQDKP to start messing around with this and trying the Zerosum DKP and other modes without messing with what we have setup now. The "*" designates a Vent Admin but has no bearing on anything loot or DKP wise.
Blip
|
|
Back to top |
|
 |
Lokorin Site Admin
Joined: 03 Apr 2006 Posts: 697
|
Posted: Wed May 24, 2006 7:21 am Post subject: |
|
|
The '*' is ignored by the parser. I wanted the preprocessor to be as simple as possible, so it does not remove unnecessary inline data.
|
|
Back to top |
|
 |
|
|