Just to extract firewall data I need this complex regex.
Code: Select all
(?n)firewall,info\s[Mm]ikro[Tt]ik:\s(?:(?<rule>\S+)\s)?(?<chain>.+?):\sin:(?<in_if>.*?)\sout:(?<out_if>[^,]+),(?:\spacket-mark:(?<packet_mark>\S+))?(?:\sconnection-mark:(?<connection_mark>\S+))?(?:\sconnection-state:(?<connection_state>\S+))?(?:\ssrc-mac\s(?<src_mac>[^,]+),)?\sproto\s(?<protocol>\S+)(\s\((?<flag>[^\)]*)\))?,\s\[?(?<src_ip>(?:\d+\.\d+\.\d+\.\d+|[^\]]+))\]?(?::(?<src_port>[^-]+))?->\[?(?<dest_ip>(?:\d+\.\d+\.\d+\.\d+|[^\]]+))(?:\]?:(?<dest_port>[^,]+))?,\s(?:NAT[^,]+, )?(prio\s(?<prio>[^,]+),\s)?len\s(?<length>\d+)
Logging mess was also reported to Mikrotik support 5 years ago with feedback that they will look at it. Nothing has happend.
viewtopic.php?t=124291