sh 检查markLogic日志

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 检查markLogic日志相关的知识,希望对你有一定的参考价值。

#Just looking into the 1am high loads on xstore boxes and have made a couple of loops that might be useful (or modifiable to make them useful) at some point – they do a line count for each hour of the last five days of the logs on the live xstore nodes, and output the results as a Jira-ready table:

#ErrorLog:
for i in {056..064} {156..164}; do ssh -qt xstore${i} 'echo -n "*$(hostname)*";echo;echo -n "||Date:||"; for t in {5..0}; do echo -n "$(date +%d-%m-%y --date="-${t} day")||";done;echo;for h in {00..23}; do echo -n "||${h}:00|";for t in {5..1}; do echo -n "$(cat /xstore/Logs/ErrorLog_${t}.txt| grep "$(declare -i day=$(date +%d)-${t};echo $(date +%Y-%m-)$day) ${h}" |wc -l)|";done;echo -n "$(cat /xstore/Logs/ErrorLog.txt | grep "$(date +%Y-%m-%d) ${h}" |wc -l)|";echo;done';echo;done

#AccessLog (prompts for port number, so you can check whichever app server you’re interested in):
read -p 'Port number of AccessLog: ' port; for i in {056..064} {156..164}; do ssh -qt xstore${i} 'echo -n "*$(hostname)*";echo;echo -n "||Date:||"; for t in {5..0}; do echo -n "$(date +%d-%m-%y --date="-${t} day")||";done;echo;for h in {00..23};  do echo -n "||${h}:00|"; for t in {5..1}; do echo -n "$(cat /xstore/Logs/$port_AccessLog_${t}.txt| grep "$(declare -i day=$(date +%d)-${t};echo ${day}/$(date +%b/%Y)):${h}" |wc -l)|"; done; echo -n "$(cat /xstore/Logs/${port}_AccessLog.txt | grep "$(date +%d/%b/%Y):${h}" |wc -l)|"; echo; done'; echo;done 

以上是关于sh 检查markLogic日志的主要内容,如果未能解决你的问题,请参考以下文章

sh MarkLogic chkconfig循环

带参数的marklogic调用函数

使用 XQuery 从查询控制台读取 MarkLogic 日志

如何检查用户是不是能够在 marklogic 数据库中更新或插入文档?

如何检查传递的对象是否是MarkLogic中的有效JSON?

如何在指定的时间范围内打印从日志文件中提取的行?