diff --git a/config.yml b/config.yml index 796ef9e..7d63f43 100644 --- a/config.yml +++ b/config.yml @@ -24,7 +24,7 @@ flow_event: keys: - country.names.en # Additional configurations - # - location + - location # - city # - traits # - postal diff --git a/heidpi/heiDPI_logger.py b/heidpi/heiDPI_logger.py index 7206dfc..135d303 100644 --- a/heidpi/heiDPI_logger.py +++ b/heidpi/heiDPI_logger.py @@ -80,7 +80,7 @@ def heidpi_flow_processing(config_dict: dict, json_dict: dict): del current_data else: try: - if not keys in json_dict["src_geoip2_city"]: + if not keys in response: raise geoip2.errors.AddressNotFoundError(f"Error in key: {keys}") json_dict["src_geoip2_city"][keys] = response[keys] except geoip2.errors.AddressNotFoundError: @@ -112,7 +112,7 @@ def heidpi_flow_processing(config_dict: dict, json_dict: dict): del current_data else: try: - if not keys in json_dict["dst_geoip2_city"]: + if not keys in response: raise geoip2.errors.AddressNotFoundError(f"Error in key: {keys}") json_dict["dst_geoip2_city"][keys] = response[keys] except Exception as e: