I need to get the value after the last colon in this example 1234567
client:user:username:type:1234567
I don\'t need anything else from the
You could also use pygrok.
from pygrok import Grok text = "client:user:username:type:1234567" pattern = """%{BASE10NUM:type}""" grok = Grok(pattern) print(grok.match(text))
returns
{'type': '1234567'}