Re: Re for Apache log file format

2013-10-09 Thread Piet van Oostrum
Sam Giraffe writes: > Hi, > > I am trying to split up the re pattern for Apache log file format and seem to > be having some > trouble in getting Python to understand multi-line pattern: > > #!/usr/bin/python > > import re > > #this is a single line > string = '192.168.122.3 - - [29/Sep/2013:03:

Re: Re for Apache log file format

2013-10-08 Thread Cameron Simpson
On 08Oct2013 10:59, Skip Montanaro wrote: | > Aiui apache log format uses space as delimiter, encapsulates strings in | > '"' characters, and uses '-' as an empty field. | | Specifying the field delimiter as a space, you might be able to use | the csv module to read these. I haven't done any Apac

Re: Re for Apache log file format

2013-10-08 Thread Skip Montanaro
> Aiui apache log format uses space as delimiter, encapsulates strings in > '"' characters, and uses '-' as an empty field. Specifying the field delimiter as a space, you might be able to use the csv module to read these. I haven't done any Apache log file work since long before the csv module was

Re: Re for Apache log file format

2013-10-08 Thread Denis McMahon
On Mon, 07 Oct 2013 23:33:31 -0700, Sam Giraffe wrote: > I am trying to split up the re pattern for Apache log file format and > seem to be having some trouble in getting Python to understand > multi-line pattern: Aiui apache log format uses space as delimiter, encapsulates strings in '"' charac

Re: Re for Apache log file format

2013-10-08 Thread Neil Cerutti
On 2013-10-08, Sam Giraffe wrote: > > Hi, > > I am trying to split up the re pattern for Apache log file format and seem > to be having some trouble in getting Python to understand multi-line > pattern: > > #!/usr/bin/python > > import re > > #this is a single line > string = '192.168.122.3 - - [2

Re: Re for Apache log file format

2013-10-08 Thread Andreas Perstinger
On 08.10.2013 08:33, Sam Giraffe wrote: #this is a single line string = '192.168.122.3 - - [29/Sep/2013:03:52:33 -0700] "GET / HTTP/1.0" 302 276 "-" "check_http/v1.4.16 (nagios-plugins 1.4.16)"' #trying to break up the pattern match for easy to read code pattern = re.compile(r'(?P\d{1,3}\.\d{1,3

Re for Apache log file format

2013-10-08 Thread Sam Giraffe
Hi, I am trying to split up the re pattern for Apache log file format and seem to be having some trouble in getting Python to understand multi-line pattern: #!/usr/bin/python import re #this is a single line string = '192.168.122.3 - - [29/Sep/2013:03:52:33 -0700] "GET / HTTP/1.0" 302 276 "-" "