aws_scripts/process_aws_api.py
def pre_process_logs_for_encoder(self, dst_dir, dst_file,
                                     feature_list=default_feature_list, debug=True):
        """
        pre-process cloud trail logs in order to:
        - convert aws regions to integer
        - convert event source to integer
        - extract principal ID, account ID and invokedBy from "useridentity" feature of each log
        - extract parameters from requestparameters (json) to individual columns
        """
        self.log_df = pd.read_csv(self.log_file, usecols=feature_list)[feature_list]
        #collected_logs = convert_aws_region_to_int(collected_logs)
        #collected_logs.replace({"eventsource": service_dict}, inplace=True)
        self.extract_user_identity_features()
        try:
            self.extract_request_parameters()
        except AttributeError:
            pass

        if debug:
            print_yellow(self.log_df.columns)
            print_yellow(self.log_df.head(10))

        self.log_df.to_csv(dst_dir+dst_file, sep=' ', header=False, index=False)
        return dst_file

        pre-process cloud trail logs in order to:
        - convert aws regions to integer
        - convert event source to integer
        - extract principal ID, account ID and invokedBy from "useridentity" feature of each log
        - extract parameters from requestparameters (json) to individual columns
        
pre-process cloud trail logs in order to:
convert aws regions to integer
convert event source to integer
extract principal ID, account ID and invokedBy from "useridentity" feature of each log
extract parameters from requestparameters (json) to individual columns
pre - process cloud trail logs in order to : convert aws regions to integer convert event source to integer extract principal ID account ID and invokedBy from " useridentity " feature of each log extract parameters from requestparameters ( json ) to individual columns
def pre_process_logs_for_encoder(self, dst_dir, dst_file,
                                     feature_list=default_feature_list, debug=True):
        self.log_df = pd.read_csv(self.log_file, usecols=feature_list)[feature_list]
        self.extract_user_identity_features()
        try:
            self.extract_request_parameters()
        except AttributeError:
            pass
        if debug:
            print_yellow(self.log_df.columns)
            print_yellow(self.log_df.head(10))
        self.log_df.to_csv(dst_dir+dst_file, sep=' ', header=False, index=False)
        return dst_file
def pre_process_logs_for_encoder ( self , dst_dir , dst_file , feature_list = default_feature_list , debug = True ) : self . log_df = pd . read_csv ( self . log_file , usecols = feature_list ) [ feature_list ] self . extract_user_identity_features ( ) try : self . extract_request_parameters ( ) except AttributeError : pass if debug : print_yellow ( self . log_df . columns ) print_yellow ( self . log_df . head ( 10 ) ) self . log_df . to_csv ( dst_dir + dst_file , sep = ' ' , header = False , index = False ) return dst_file
pre-process cloud trail logs in order to:
 convert aws regions to integer
 convert event source to integer
 extract principal ID, account ID and invokedBy from "useridentity" feature of each log
 extract parameters from requestparameters (json) to individual columns
pre - process cloud trail logs in order to : convert aws regions to integer convert event source to integer extract principal ID account ID and invokedBy from " useridentity " feature of each log extract parameters from requestparameters ( json ) to individual columns
"""
        pre-process cloud trail logs in order to:
        - convert aws regions to integer
        - convert event source to integer
        - extract principal ID, account ID and invokedBy from "useridentity" feature of each log
        - extract parameters from requestparameters (json) to individual columns
        """ #collected_logs = convert_aws_region_to_int(collected_logs) #collected_logs.replace({"eventsource": service_dict}, inplace=True)
self
dst_dir
dst_file
feature_list
debug