I'm struggling to match the last IP in pattern which may contain a comma separated list of IPs.
e.g. both of these appear in my logs:
foo\t102.35.174.94\tbar
-
102.35.174.94is my desired match
foo\t102.35.174.94,66.249.83.219\tbar
-
66.249.83.219is my desired match
I haven't seen more than 2 IPs in a row yet, but assume that's possible.
I was hoping something like this would work but no luck yet:
\t(?<x_forwarded_for>(.*(%{IP}$)))\t
Any suggestions? Thank you in advance.