I am trying to find a way to get Robot Framework to grab text between known strings in log files. I'd like to use this to grab variables (like IP addresses) to pass them on through my Testplans.
Example Logs: (Note the varied timestamps, I have no control over these and devs seem to like changing them for some reason.)
[2014-10-11T22:34:00.11] TCPConnect - Connecting to 192.168.21.139 on port 8030.
[2014-10-11 22:34:00.11] TCPConnect - Connecting to devbox01 on port 9718.
[2014-10-11] [22:34:00.11] TCPConnect - Connecting to devbox01.here.local.net on port 8712.
If I use the keyword 'Get Lines Matching Regexp' and the regex:
(?<=.*Connecting to )(.*?)(?= on port .*)
I get:
error: look-behind requires fixed-width pattern
I would expect to get the IP address, hostname and anything else between 'Connecting to ' and ' on port', but this is not the case. I understand this has to to with python 2.6 and apparently 2.7 will include this functionality, however; I am hoping to sort this out within current releases.
Anyone have any ideas?