|
|
|
|
@ -10,6 +10,7 @@ global $infile;
|
|
|
|
|
global $configfile;
|
|
|
|
|
global $argv;
|
|
|
|
|
global $argc;
|
|
|
|
|
global $debug;
|
|
|
|
|
|
|
|
|
|
class EventMeta {
|
|
|
|
|
public $eventrecordid;
|
|
|
|
|
@ -59,14 +60,33 @@ $edataelement = new EventData();
|
|
|
|
|
$edataarray = array();
|
|
|
|
|
$emeta = new EventMeta();
|
|
|
|
|
$infile = "";
|
|
|
|
|
$debug = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function sql_addmeta ($data, $darray) {
|
|
|
|
|
global $debug;
|
|
|
|
|
$data->status = 0;
|
|
|
|
|
$data->result = 0;
|
|
|
|
|
|
|
|
|
|
if ($data->eventid == 0) {
|
|
|
|
|
// do something
|
|
|
|
|
if ($debug == true) {
|
|
|
|
|
printf ("Ignore EventID==0: eventrecordid:'%s','%s',eventid:'%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s');\n",
|
|
|
|
|
$data->eventrecordid,
|
|
|
|
|
$data->time,
|
|
|
|
|
$data->eventid,
|
|
|
|
|
$data->task,
|
|
|
|
|
$data->level,
|
|
|
|
|
substr($data->keywords, 0, 32),
|
|
|
|
|
substr($data->computer, 0, 64),
|
|
|
|
|
substr($data->server, 0, 64),
|
|
|
|
|
substr($data->username, 0, 64),
|
|
|
|
|
substr($data->domainname, 0, 64),
|
|
|
|
|
substr($data->servicename, 0, 64),
|
|
|
|
|
substr($data->data, 0, 64),
|
|
|
|
|
substr($data->status, 0, 16)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
// default
|
|
|
|
|
@ -214,6 +234,7 @@ function errorexit($text) {
|
|
|
|
|
|
|
|
|
|
if (isset ($argv) && isset ($argc)) {
|
|
|
|
|
global $infile;
|
|
|
|
|
global $debug;
|
|
|
|
|
|
|
|
|
|
$i = 0;
|
|
|
|
|
|
|
|
|
|
@ -223,6 +244,10 @@ if (isset ($argv) && isset ($argc)) {
|
|
|
|
|
if ($i >= $argc) ErrorExit ("filename missing\n");
|
|
|
|
|
$infile = $argv[$i];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (strstr($argv[$i], "-d") <> false) {
|
|
|
|
|
$debug = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|