code: def parse(self, line):
          
          csv_list = line.split(",")
          date_time_message = csv_list.pop(0).split(" ", 2)
          otherinfo = dict()
  
          for item in csv_list:
              key_value_pair = item.split(":", 1)
              key = key_value_pair[0].strip()
  
              if len(key_value_pair) > 1:
                  value = key_value_pair[1].strip()
                  if not value:
                      value = "-"
              else:
                  value = "-"
  
              otherinfo[key] = value
  
          self.message = '%s\n' \
                         'Date: %s\n' \
                         'Time: %s\n' \
                         'Request: %s\n' \
                         'Referrer: %s\n' \
                         'Server: %s\n' \
                         'Client: %s\n' \
                         'Host: %s\n' \
                         'Upstream: %s\n'
          self.params = [
              date_time_message[2],
              date_time_message[0],
              date_time_message[1],
              otherinfo.get("request", "-"),
              otherinfo.get("referrer", "-"),
              otherinfo.get("server", "-"),
              otherinfo.get("client", "-"),
              otherinfo.get("host", "-"),
              otherinfo.get("upstream", "-"),
          ]
          self.site = otherinfo.get("referrer", "-")
docs: Parse a line of the Nginx error log