<s> import urlparse <EOL> from . filter import Filter <EOL> class Url ( Filter ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , field = '<STR_LIT:data>' , on_error = '<STR_LIT>' ) : <EOL> super ( Url , self ) . __init__ ( on_error = on_error ) <EOL> self . field = field <EOL> def process ( self , event ) : <EOL> if self . field in event : <EOL> url = event . pop ( self . field ) <EOL> url . split ( '<STR_LIT:?>' , <NUM_LIT:1> ) <EOL> r = urlparse . urlparse ( url ) <EOL> event [ '<STR_LIT:path>' ] = r . path <EOL> event . update ( dict ( urlparse . parse_qsl ( r . query ) ) ) </s>
