def parse_siem_success_response(self, response, file_format):
        """Parsing SIEM responses depending on file format parameter."""
        if response.headers.get('Content-Type') == 'application/octet-stream':
            parsed_events = SIEMResponseHelper.parse_compressed_data(response, file_format)
            return parsed_events
        else:
            try:
                response_text = json.loads(response.text)
            except json.JSONDecodeError:
                logging.error(self.mimecast_endpoint + ": Invalid content provided. Probably no more logs left.")
                raise InvalidDataError('No more logs.')
            else:
                if response_text['fail']:
                    logging.error(self.mimecast_endpoint + ": " + response_text['fail'][0]['errors'][0]['message'])
                    raise MimecastRequestError(self.mimecast_endpoint + ": " + response_text['fail'][0]['errors'][0]['message'])
Parsing SIEM responses depending on file format parameter.
Solutions/MimecastSEG/Data Connectors/Helpers/siem_response_helper.py