Compare commits

..

No commits in common. "250958670c67d0c4480e8e393e08b3c603261752" and "26a4760a13e0756d0702883f61377e3d539edcda" have entirely different histories.

1 changed files with 0 additions and 42 deletions

View File

@ -1,42 +0,0 @@
function process(event) {
var msg = event.Get("message");
var i
msg = msg.replace("/\r/g", "");
msg = msg.replace("/\n/g", "");
msg = msg.replace("/\r/\n/g", "");
var fields = msg.split("\t");
if (Number(fields[1]) == 64) {
// log_id = 64的日志是子后台同步过来的需要特殊处理掉
event.Cancel(); return;
}
for (i = 0; i < 25; i++) {
if (fields[i] == null) {
fields[i] = "";
} else if (fields[i].trim() == "-") {
fields[i] = "";
} else {
fields[i] = fields[i].trim();
}
}
event.Put("log_datetime", fields[0]);
event.Put("log_id", fields[1]);
event.Put("role_id", fields[2]);
event.Put("role_name", fields[3]);
event.Put("account_id", fields[4]);
var ws = fields[4].split("_") // 从account_id分离spid和channel
// account_id中只有第一个部分是描述spid的故spid和channel使用相同的信息填充
event.Put("spid", ws[0]);
event.Put("channel", ws[0]);
for (i = 5; i < fields.length; i++) {
event.Put("col" + (i - 4), fields[i]);
}
return event;
}