I have following string :
Jul 20 16:47:43 chefawsdeveastbck2 dhclient[1036]: bound to 10.205.5.122 -- renewal in 1797 seconds.
Jul 17 18:07:15 chefawsdeveastbck2 Keepalived_vrrp[937]: VRRP_Instance(PC_VI) Sending gratuitous ARPs on eth0 for 10.205.5.121
Jul 17 18:07:10 chefawsdeveastbck2 Keepalived_vrrp[937]: VRRP_Instance(PC_VI) Sending gratuitous ARPs on eth0 for 10.205.5.121
Jul 17 18:07:10 chefawsdeveastbck2 Keepalived_vrrp[937]: VRRP_Instance(PC_VI) setting protocol VIPs.
Jul 17 18:07:10 chefawsdeveastbck2 Keepalived_vrrp[937]: VRRP_Instance(PC_VI) Entering MASTER STATE
Jul 17 18:07:09 chefawsdeveastbck2 Keepalived_vrrp[937]: VRRP_Instance(PC_VI) Transition to MASTER STATE
Jul 17 18:07:09 chefawsdeveastbck2 Keepalived_vrrp[937]: VRRP_Instance(PC_VI) Transition to Backup STATE
I only need to extract "MASTER STATE" , "backup STATE", "Backup STATE" from the above strings , which will always appear after "VRRP_Instance(PC_VI) Entering" or "VRRP_Instance(PC_VI) Transition to". Right now , i have wrote the following:
.*(VRRP_Instance.*.[EnteringTransitionto]+ )(?P<instance_state>.+)
It obviously is not right and picking up other strings as well. Please help.
