def filter_unique_data_and_post(
        self,
        data_to_post,
        hash_file_state_manager_obj,
        table_name,
        checkpoint_data,
        checkpoint_obj,
        next_page_token_flag,
    ):
        """Filter unique data from the given data and post it to Azure Sentinel Log Analytics.

        Args:
            data_to_post (list): The data to be posted to azure Sentinel log analytics.
            hash_file_state_manager_obj (StateManager): The StateManager object to retrieve hash checkpoint data.
            table_name (str): The custom log table name in which data will be added.
            checkpoint_data (dict): The checkpoint data to be updated.
            checkpoint_obj (StateManager): The StateManager object to post checkpoint data to.
            next_page_token_flag (bool): A flag indicating whether a next page token is present.

        Returns:
            bool: True if checkpoint data is deleted, otherwise False.
        """
        __method_name = inspect.currentframe().f_code.co_name
        try:
            if self.first_page:
                data_to_post = self.compare_data_with_checkpoint(
                    data_to_post, hash_file_state_manager_obj
                )
                self.first_page = False
            if len(data_to_post) > 0:
                applogger.info(
                    self.log_format.format(
                        consts.LOGS_STARTS_WITH,
                        __method_name,
                        self.azure_function_name,
                        "Posting data to azure Sentinel log analytics, data count : {}.".format(
                            len(data_to_post)
                        ),
                    )
                )
                post_data(json.dumps(data_to_post), log_type=table_name)
                if not next_page_token_flag:
                    if checkpoint_data:
                        applogger.info(
                            self.log_format.format(
                                consts.LOGS_STARTS_WITH,
                                __method_name,
                                self.azure_function_name,
                                "New data found in same last page, so resetting checkpoint",
                            )
                        )
                        checkpoint_data.update(
                            {"date": datetime.datetime.utcnow().isoformat()}
                        )
                    else:
                        checkpoint_data = {
                            "date": datetime.datetime.utcnow().isoformat()
                        }
                    self.post_checkpoint_data(checkpoint_obj, checkpoint_data)
                return False
            else:
                applogger.info(
                    self.log_format.format(
                        consts.LOGS_STARTS_WITH,
                        __method_name,
                        self.azure_function_name,
                        "Data already posted to sentinel, no new data found.",
                    )
                )
                return self.compare_last_pagetoken_time(
                    checkpoint_data, checkpoint_obj, hash_file_state_manager_obj
                )

        except MimecastException:
            raise MimecastException()
        except Exception as err:
            applogger.error(
                self.log_format.format(
                    consts.LOGS_STARTS_WITH,
                    __method_name,
                    self.azure_function_name,
                    consts.UNEXPECTED_ERROR_MSG.format(err),
                )
            )
            raise MimecastException()
Filter unique data from the given data and post it to Azure Sentinel Log Analytics.

        Args:
            data_to_post (list): The data to be posted to azure Sentinel log analytics.
            hash_file_state_manager_obj (StateManager): The StateManager object to retrieve hash checkpoint data.
            table_name (str): The custom log table name in which data will be added.
            checkpoint_data (dict): The checkpoint data to be updated.
            checkpoint_obj (StateManager): The StateManager object to post checkpoint data to.
            next_page_token_flag (bool): A flag indicating whether a next page token is present.

        Returns:
            bool: True if checkpoint data is deleted, otherwise False.
        
Solutions/Mimecast/Data Connectors/MimecastAT/SharedCode/utils.py