CompareLists

Compare two lists and put the differences in context.

python · Common Scripts

Details

IDCompareLists
Languagepython
From Version5.0.0
Docker Imagedemisto/python3:3.12.13.10404775

README

Compare two lists and put the differences in context.

Script Data


Name Description
Script Type python3
Cortex XSOAR Version 5.0.0

Used In


This script is used in the following playbooks and scripts.

  • Allow IP - Okta Zone
  • Checkpoint - Block IP - Append Group
  • Checkpoint - Block IP - Custom Block Rule
  • IP Whitelist - AWS Security Group
  • IP Whitelist - GCP Firewall

Inputs


Argument Name Description
left Left list
right Right list

Outputs


Path Description Type
ListCompare.LeftOnly Items only found within the list in the left argument Unknown
ListCompare.RightOnly Items only found within the list in the right argument Unknown
ListCompare.Both Common items that were found in both lists Unknown
from CompareLists import compare


def test_compare():
    leftArg = [1, 2, 3]
    rightArg = [2, 3, 4]
    result = compare(leftArg, rightArg)
    assert result == {"ListCompare": {"LeftOnly": [1], "RightOnly": [4], "Both": [2, 3]}}