Regular Expressions 101

Library entries

REGEX to parse IIS7 Log File into FluentD

Vote

4

Regular Expression
pcre

/
^(?<date>\d{4}\-\d{2}\-\d{2}\s+)(?<time>\d{2}\:\d{2}\:\d{2}\s+)(?<sip>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\s+)(?<csmethod>.+?\s+)(?<csuristem>.+?\s+)(?<csuriquery>.+?\s+)(?<sport>\d{1,3}\s+)(.+?\s+)(?<cip>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\s+)(?<csUseragent>.+?\s+)(?<scstatus>\d{1,3}\s+)(?<scsubstatus>\d{1,3}\s+)(?<scwin32status>\d+\s+)(?<scbytes>\d+\s+)(?<csbytes>\d+\s+)(?<timetaken>\d+)?$
/

Description

Loading markdown...
Submitted by Juan Carniglia - 8 years ago