要从log日志中查找alarm 的信息,该如何提取出来原样写到表格里呢,正则表达提取时总是进入死循环,alarm 信息行数是不固定的,明显的区别的部分就是与其他内容多了断线之间的标识。
<HNCS-PS-DPI-SW-XPQ-S9312-CSS>display alarm all
----------------------------------------------------------------------------
Warning 2021-09-03 00:26:44 The "PWR SWITCH_STATE" sensor3 of [C
hassis1/PWR4] detects power is online, bu
t no supply.
Warning 2021-09-03 00:26:44 The "PWR SWITCH_STATE" sensor3 of [C
hassis1/PWR2] detects power is online, bu
t no supply.
Warning 2021-09-03 00:26:42 The "PWR PWR_LACK" sensor2 of [Chass
is1/PWR4] detects a fault.
Warning 2021-09-03 00:26:40 The "PWR PWR_LACK" sensor2 of [Chass
is1/PWR2] detects a fault.
Warning 2021-09-03 00:26:21 The "PWR SWITCH_STATE" sensor3 of [C
hassis2/PWR4] detects power is online, bu
t no supply.
Warning 2021-09-03 00:26:16 The "PWR PWR_LACK" sensor2 of [Chass
is2/PWR4] detects a fault.
Warning 2021-09-03 00:26:14 The "PWR SWITCH_STATE" sensor3 of [C
hassis2/PWR2] detects power is online, bu
t no supply.
Warning 2021-09-03 00:26:11 The "PWR PWR_LACK" sensor2 of [Chass
is2/PWR2] detects a fault.
----------------------------------------------------------------------------
<HNCS-PS-DPI-SW-XPQ-S9312-CSS>