class_docstr: Key/value record parser
class_docstr_tok: ["Key\/value","record","parser"]
docstr: Extract the key/value record from the string of data
  
  Args:
      data (str): String of data from which to extract key/value information
  
  Returns:
      dict: Parsed keys and values from the string data, False upon failure
docstr_tok: ["Extract","the","key\/value","record","from","the","string","of","data","Args",":","data","(","str",")",":","String","of","data","from","which","to","extract","key\/value","information","Returns",":","dict",":","Parsed","keys","and","values","from","the","string","data",",","False","upon","failure"]
code: def _extract_record(self, data):
      """Extract the key/value record from the string of data
  
      Args:
          data (str): String of data from which to extract key/value information
  
      Returns:
          dict: Parsed keys and values from the string data, False upon failure
      """
      kv_payload = {}
      try:
          # remove any blank strings that may exist in our list
          fields = [
              field for field in data.split(self.delimiter) if field
          ]
          # first check the field length matches our # of keys
          if len(fields) != len(self._schema):
              return False
  
          for index, field in enumerate(fields):
              # verify our fields contains the separator
              if self.separator not in field:
                  LOGGER.error(
                      "separator '%s' not found in field: %s",
                      self.separator,
                      field,
                  )
                  continue
  
              # only take data preceeding the first occurence of the field as the key
              key, value = field.split(self.separator, 1)
              # handle duplicate keys
              if key in kv_payload:
                  # load key from our configuration
                  kv_payload[list(self._schema.keys())[index]] = value
              else:
                  # add the data value
                  kv_payload[key] = value
  
      except UnicodeDecodeError:
          return False
  
      return kv_payload
  
imports: from abc import ABCMeta, abstractmethod
  from copy import deepcopy
  import csv
  from fnmatch import fnmatch
  import json
  import logging
  import re
  import io
  import jmespath
  from streamalert.shared.logger import get_logger
label_desc: Use image node_id 4 for calling the KVParser obj's underlying member method code with example usage: obj._extract_record(data) and returns: kv_payload, False, False