import jsondef extract_src_ips(file_path, output_path): ips = set() with open(file_path, 'r') as file: for line in file: try: data = json.loads(line) if 'src_ip' in data: ips.add(data['src_ip']) if 'flow' in data and 'src_ip' in data['flow']: ips.add(data['flow']['src_ip']) except json.JSONDecodeError: print(f"Error decoding JSON in line: {line}") with open(output_path, 'w') as output_file: for ip in ips: output_file.write(ip + '\n')# Specify the input file path and the output file pathinput_file_path = 'C:/Users/X/Desktop/input.json'output_file_path = 'C:/Users/X/Desktop/ips.txt'# Extract src_ips and save to fileextract_src_ips(input_file_path, output_file_path)