I have a list of strings from which I want to extract all relevant information using `regex`. I have written a pattern to extract the information I need. the pattern is as follows

```
pattern1 = "(?P<host>\d*\.\d*\.\d*\.\d*[^0-9]*) - (?P<user_name>\w*\d*)|(?P<time>\d*/\w*/\d*:\d*:\d*:\d* -\d*)|\"(?P<request>[A-Z]* (/[a-z+]*)+ [A-Z]*/\d\.\d)"

result = [item.groupdict() for item in re.finditer(pattern1,logdata)]

```

Multiple dictionaries are generated as follows. This is ***sort of*** the answer I am looking for

```
[{'host': '146.204.224.152',
  'user_name': 'feest6811',
  'time': None,
  'request': None},
 {'host': None,
  'user_name': None,
  'time': '21/Jun/2019:15:45:24 -0700',
  'request': None},
 {'host': None,
  'user_name': None,
  'time': None,
  'request': 'POST /incentivize HTTP/1.1'},

 ...

]

```

In the output `3 dictionaries` are formed each containing a piece of the required information. I want a single dictionary with all the information as follows

```
{
  'host': '146.204.224.152',
  'user_name': 'feest6811',
  'time': '21/Jun/2019:15:45:24 -0700',
  'request': 'POST /incentivize HTTP/1.1'
}

```

I am not sure what I am doing wrong. Is there any way to merge the dictionaries as they are formed?

these are few samples from logdata

```
'146.204.224.152 - feest6811 [21/Jun/2019:15:45:24 -0700] "POST /incentivize HTTP/1.1" 302 4622',
 '197.109.77.178 - kertzmann3129 [21/Jun/2019:15:45:25 -0700] "DELETE /virtual/solutions/target/web+services HTTP/2.0" 203 26554',
 '156.127.178.177 - okuneva5222[21/Jun/2019:15:45:27 -0700] "DELETE /interactive/transparent/niches/revolutionize HTTP/1.1" 416 14701',

```