[Pyparsing] help with delimitedList
Brought to you by:
ptmcg
From: Adam L. <ad...@su...> - 2011-05-10 16:45:39
|
Having a hard time getting to grips with pyparsing, especially as related to syslog parsing. Using the following line as a sample, how would you parse the delimited list of key=value pairs? I've got the date/time, hostname, syslog tag parts without problem but I'm unsure how to use the delimitedList operator. I'm using the following: equals = Literal('=').setName('equals') key_value = Word(printables) + equals + Word(printables) delimitedList(OneOrMore(key_value)) + Optional(Word(printables)) 2011-05-08T04:07:18-04:00 host01 postfix/qmgr[12757]: 5A7D92478EE: from=<7ob...@gs...>, size=13908, nrcpt=1 (queue active) I get the following error: Expected equals (at char 104), (line:1, col:105) |