Can you help me extract an IP from this syslog message?
Code: Select all
# Capture the second IP with the condition that it does not match these segments:
# 86.127.X.X or 79.116.X.X
{
:local ip1 "killing ike2 SA: ike2-peer 86.127.123.45[4500]-161.35.236.116[41372] spi:1f437655d5e822c2:314dde078ba2c8dd"
:local ip2 [:pick $ip1 ([:find $ip1 "]"]+2) 999]
:put [:pick $ip2 0 [:find $ip2 "["]]
}
Result:
161.35.236.116
Thanks in advance.
BR: