yalp.parsers.urlΒΆ

Extract components of a url.

The parser supports the following configuration items:

field
The field containing the url string to parse. If the field is not found in the event, the event will be skipped. Defaults to request.
out_field
The field to set the url components to. Defaults to url.
type
A type filter. Events not of this type will be skipped.

Example configuration.

parsers:
  - url:
      field: 'request'

With an input event like the following:

{
    'hostname': 'server_hostname',
    'time_stamp': '2015-01-01T01:00:00',
    'request': '/index.html?param1=val1&param2=val2',
}

After the parser runs, the event will become:

{
    'hostname': 'server_hostname',
    'time_stamp': '2015-01-01T01:00:00',
    'request': '/index.html?param1=val1&param2=val2',
    'url': {
        'fragment': '',
        'hostname': None,
        'netloc': '',
        'params': '',
        'password': None,
        'path': '/index.html',
        'port': None,
        'query': {
            'param1': ['val1'],
            'param2': ['val2'],
        },
        'scheme': '',
        'username': None
    },
}