Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Python

r"
^(?P<LogTime>[A-Za-z0-9 :]+)\s(?P<Hostname>[a-z0-9.-]+)\s(?:ae_(?P<EnvIdentity>[a-z-]+):)\s(?P<ModuleName>[a-zA-Z._]+)?\s-\s(?P<LogLevel>[A-Z]+)\s-\s(?:\[JID:(gen:)?(?P<TaskId>[a-z0-9-]+)\]\s?)?(?:\[FID:(?P<FieldId>[a-z0-9-]+)\]\s?)?(?:\[Itin:(?P<Itinerary>[A-Za-z0-9]+)(?:->(?P<Step>[A-Z0-9a-z]+))?\]\s?)?(?:\[State:(?P<State>[A-Za-z]+)\]\s?)?(?:alias=(?P<StepAlias>[a-z0-9]+),\s)?(?:runtime_s=\[?(?P<JobRuntimeSeconds>[0-9.]+)\]?\s?)?(?:metadata=(?P<Metadata>{.*}))?$
"
gm

Description

no description available

Submitted by anonymous - 5 years ago