Форум сайта python.su
0
Добрый день
Пытаюсь понять поподает ли в лог ошибки или нет. Когда ошибки, в лог сыпится такое
2014-10-10 12:35:38.129 <0.4444.0> Supervisor {<0.4444.0>,riak_pipe_vnode_worker_sup} had child undefined started with {riak_pipe_vnode_worker,start_link,undefined} at <0.7575.7> exit with reason processing_error in context child_terminatedПробую выделить эти ошибки и если их больше, чем три штуки подрят выполнять действия. Но что то не получается подсчитать.
2014-10-10 12:35:38.249 <0.7577.7> gen_fsm <0.7577.7> in state wait_for_input terminated with reason: processing_error
2014-10-10 12:35:38.249 <0.7577.7> CRASH REPORT Process <0.7577.7> with 0 neighbours exited with reason: processing_error in gen_fsm:terminate/7 line 622
2014-10-10 12:35:38.249 <0.4444.0> Supervisor {<0.4444.0>,riak_pipe_vnode_worker_sup} had child undefined started with {riak_pipe_vnode_worker,start_link,undefined} at <0.7577.7> exit with reason processing_error in context child_terminated
2014-10-10 12:35:38.465 <0.7581.7> gen_fsm <0.7581.7> in state wait_for_input terminated with reason: processing_error
2014-10-10 12:35:38.465 <0.7581.7> CRASH REPORT Process <0.7581.7> with 0 neighbours exited with reason: processing_error in gen_fsm:terminate/7 line 622
2014-10-10 12:35:38.465 <0.4474.0> Supervisor {<0.4474.0>,riak_pipe_vnode_worker_sup} had child undefined started with {riak_pipe_vnode_worker,start_link,undefined} at <0.7581.7> exit with reason processing_error in context child_terminated
2014-10-10 12:35:38.487 <0.7583.7> gen_fsm <0.7583.7> in state wait_for_input terminated with reason: processing_error
2014-10-10 12:35:38.487 <0.7583.7> CRASH REPORT Process <0.7583.7> with 0 neighbours exited with reason: processing_error in gen_fsm:terminate/7 line 622
2014-10-10 12:35:38.488 <0.4468.0> Supervisor {<0.4468.0>,riak_pipe_vnode_worker_sup} had child undefined started with {riak_pipe_vnode_worker,start_link,undefined} at <0.7583.7> exit with reason processing_error in context child_terminated
2014-10-10 12:35:38.550 <0.7585.7> gen_fsm <0.7585.7> in state wait_for_input terminated with reason: processing_error
2014-10-10 12:35:38.550 <0.7585.7> CRASH REPORT Process <0.7585.7> with 0 neighbours exited with reason: processing_error in gen_fsm:terminate/7 line 622
log = run('tail /opt/data/rtc_mod_purse/log/rtc_mod_purse_error.log') preg='\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3} \[error\] .* in state wait_for_input terminated with reason: processing_error\n\d{4}-\d{2}-\d{2} \d{2}:\d{2}: log.count(preg, start=0, end=10000) print log
Офлайн
С регулярками работает модуль re. А ваш код (попытка подсчитать) мягко говоря непонятен.
Офлайн