Skip to content

Instantly share code, notes, and snippets.

@jcollie
Created July 31, 2020 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcollie/02cd24dffb695210fdeaece31925c7bc to your computer and use it in GitHub Desktop.
Save jcollie/02cd24dffb695210fdeaece31925c7bc to your computer and use it in GitHub Desktop.
cialug regexes
import sys
import re
line_re = re.compile(r'^((?:\d+m)?\d+s)\s+(\S+)\s+(\S+)\s+(\S+)\s+(.*?)(?=(?:\d+m)?\d+s|\Z)', re.MULTILINE | re.DOTALL)
data = sys.stdin.read()
start = 0
while start < len(data):
match = line_re.search(data, start)
if not match:
break
print(match.groups())
start = match.end()
9m49s Normal Updated
machine/oo-r6sr3-worker-us-east-1d-nvfzh Updated machine
oo-r6sr3-worker-us-east-1d-nvfzh
9m47s Normal Updated machine/oo-r6sr3-master-1
Updated machine oo-r6sr3-master-1
9m46s Normal Updated
machine/oo-r6sr3-worker-us-east-1b-hsmsx Updated machine
oo-r6sr3-worker-us-east-1b-hsmsx
9m46s Normal Updated
machine/oo-r6sr3-worker-us-east-1a-wk5cs Updated machine
oo-r6sr3-worker-us-east-1a-wk5cs
9m46s Normal Updated
machine/oo-r6sr3-worker-us-east-1e-z9xlb Updated machine
oo-r6sr3-worker-us-east-1e-z9xlb
9m44s Normal Updated machine/oo-r6sr3-master-0
Updated machine oo-r6sr3-master-0
9m43s Normal Updated machine/oo-r6sr3-master-2
Updated machine oo-r6sr3-master-2
9m43s Normal Updated
machine/oo-r6sr3-worker-us-east-1d-tfg6x Updated machine
oo-r6sr3-worker-us-east-1d-tfg6x
9m43s Normal Updated
machine/oo-r6sr3-worker-us-east-1c-6l42j Updated machine
oo-r6sr3-worker-us-east-1c-6l42j
59s Normal SuccessfulUpdate clusterautoscaler/default
Updated ClusterAutoscaler deployment:
machine-api/cluster-autoscaler-default
4m7s Normal Pulled
pod/gateway-laravel-schedule-1296080-h43n6 Container image
"dockerregistry:4567/group/gateway/master:alpine-nodejs-fpm" already
present on machine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment