如何在textfsm解析器中查找值的首次出现?

时间:2018-11-07 08:51:22

标签: parsing python-textfsm

我正在尝试解析以下2个CLI输出。我只需要第一次出现“ Dropped protocol request:”-> 10 但它给了20 有人可以帮忙吗?

CLI OUTPUT 1:
Dropped protocol request:  10
Dropped glean request:  5
Dropped protocol request:  20

CLI OUTPUT:
Dropped protocol request: 10 (v5)
Dropped glean request: 5
Dropped protocol request: 20 n

TEMPLATE:
Value proto_req (\d+)
Value glean (\d+)

Start
^Dropped protocol request:\s+${proto_req}(.*)?
^Dropped glean request:\s+${glean}
^Dropped protocol request:\s+${proto_req}(.*)?

预先感谢

0 个答案:

没有答案