日誌篩選工具(三)

2021-07-29 02:51:51 字數 3671 閱讀 1359

service

/**

* 正在執行的程序

*/private

static maprunningprocess = new concurrenthashmap();

/** * 檢視其它機器日誌

*@param instanceaddr

*@param instance

*@param logfilename

*/public

static

void

addassistanttask(string instanceaddr, string instance, string logfilename, string username, string pwd)

string jsfile = statussupervisor.class.getresource("/log-stg-other.js").getpath();

jsfile = jsfile.substring(1, jsfile.length());

try catch (exception e) }}

}/** * 在例項上註冊資料通道

*@param instanceip 例項ip

*@param instance 例項名

*@param remoteaddr 客戶端ip

*@param token

*@throws exception

*/public

static

boolean

registerchannel(string instanceip, string instance, string remoteaddr, string token) throws exception

return tp.gettask().registerchannel(remoteaddr, token);

}/** * 讀取資料

*@param instanceaddr

*@param instance

*@param start

*@param addr

*@param channelid

*@throws exception

*/public

static logtask readdata(string instanceaddr, string instance, int start, string addr, string channelid, string filter) throws exception

return tp.gettask().readdata(start, addr, channelid, filter);

}public

static

class

taskprocess

public process getprocess()

public logtask gettask()

}/**

* 通道**/

private

static

class

channel

public string gettoken()

public

boolean

isoutofdate()

public

void

addcache(string data)

public listreadcache()

public

boolean

hasvalidcache(string filter)

}return

false;

}public

void

clearcache()

/*** 重新整理訪問時間

*/public

void

refresh()

}/**

* 日誌任務類**/

public

static

class

logtask

public

long

getlastaccess()

/*** 檢查channel

*/public

void

checkchannel()}}

private

synchronized

void

close() catch (ioexception e)

}public

boolean

registerchannel(string ip, string token)

channels.put(ip, new channel(token));

//併發註冊只能有乙個人成功

return channels.get(ip).gettoken().equals(token);

}/**

* 從指定的行開始讀取資料

*@param from

*@param addr

*@param channelid

*@param filter 過濾條件

*@return

*@throws exception

*/public

synchronized logtask readdata(int from, string addr, string channelid, string filter) throws exception

channels.get(addr).refresh();

lastaccess = new date().gettime();

listdata = new arraylist();

if(stop)

if(from == 0)

reader.setlinenumber(from);

string line = "";

try

channels.get(addr).clearcache();

begin++;

}channels.get(addr).addcache(line.replaceall("(?i)" + filter, "" + filter + ""));

}else

//單次最大讀取100條,防止併發時獨佔reader

if(begin == 100)

}if(channels.get(addr).hasvalidcache(filter))

if(from > maxline)

} catch (ioexception e)

return

new logtask(from, data);

}public

logtask(int index, listdata)

public

logtask(string logfile) throws ioexception, interruptedexception

}public listgetresults()

public

intgetindex()

//標識任務在run

public

boolean run = true;

public

boolean

isrun()

}

RTF篩選工具

您可借助此項篩選程式對具備.rtf副檔名的文件進行爬行遍歷,以便通過搜尋結果對目標文件加以訪問呼叫。管理員應先在相關伺服器上對程式檔案進行註冊,方可執行此項工具。安裝 將動態鏈結庫檔案rtffilt.dll複製到執行sharepoint portal server之計算機作業系統盤上的winnt s...

linux日誌篩選查詢命令

日誌實時監控tail f spring.log關鍵字實時監控tail f spring.log grep key 如果沒有特殊字元,可以不用引號,如果關鍵字有引號使用單引號和雙引號配合使用 輸出匹配內容上下行 輸出匹配行以及下面5行 tail f spring.log grep a 5 key 輸出...

微信開通篩選工具

微商微商微商,粉絲粉絲粉絲。粉絲是微商們最頭疼的事情,為什麼 因為沒有客源就不會有成交,沒有成交你就沒有銀子,沒有銀子你就過不上好生活。我身邊太多太多還在苦苦為增加粉絲而苦惱的微商了,如今微商,每一天新加入都有幾萬人,依靠別人新增一堆殭屍粉,有用嗎,現在的微商為了加粉,加微友,也是無所不用其極,我算...