Regular Expressions 101

Library entries

elb log filename parser

Vote

0

Regular Expression
python

"
^(?P<bucket>[^\/]+)\/(?:(?P<prefix>.+)\/)?AWSLogs\/(?P<aws_account_id>[\d]{12})\/elasticloadbalancing\/(?P<region>[\w\d\-]+)\/(?P<year>\d{4})\/(?P<month>\d{2})\/(?P<day>\d{2})\/(?P=aws_account_id)_elasticloadbalancing_(?P=region)_(?P<load_balancer_id>[\w\.\-\d]+)_(?P<end_time>\d{8}T\d{4}Z)_(?P<ip_address>(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))_(?P<random_string>.+)\.log\.gz$
"
gm

Description

Loading markdown...
Submitted by anonymous - a year ago