An engineer is writing a playbook expression to filter a list of endpoints from context. They want to return only the endpoints where the 'OS' field equals 'Windows'. Which built-in transformer syntax is correct?
Trap 1: ${Endpoints.OS(val == 'Windows')}
This syntax is invalid for filtering lists in XSOAR context.
Trap 2: ${Endpoints | filter(OS == 'Windows')}
The 'filter' keyword is not a direct pipe operator in XSOAR context expressions.
Trap 3: ${Endpoints.[?(OS == 'Windows')] }
This is not the standard transformer syntax in XSOAR.
- A
Using the 'Val' transformer with a conditional expression like 'val.OS == \'Windows\''
XSOAR transformers allow filtering lists using expressions where 'val' represents the iterated object.
- B
${Endpoints.OS(val == 'Windows')}
Why it fails: This syntax is invalid for filtering lists in XSOAR context.
- C
${Endpoints | filter(OS == 'Windows')}
Why it fails: The 'filter' keyword is not a direct pipe operator in XSOAR context expressions.
- D
${Endpoints.[?(OS == 'Windows')] }
Why it fails: This is not the standard transformer syntax in XSOAR.