Extend context in playbooks
Extend Cortex XSIAM playbook context with integration command responses, task data, and custom context keys.
Integrations do not write every command response field to Cortex XSIAM playbook context. This limits context size and stores only relevant automation data.
Extend Context saves additional data from an integration command's raw response. For example, a SIEM event command might write only selected event fields to context. Extend Context lets you save fields needed for your security workflow.
Extend Context also separates outputs when a playbook runs the same command multiple times. For example, run !ad-get-user once for a user and again for their manager. By default, both command responses use the same context key. Extend Context writes each response to a custom playbook context key.
You can extend context in a Cortex XSIAM playbook task or from the command line. First run the command with raw-response=true. This helps identify data to add.
Filter command response keys for playbook context
Use DT to select keys from a command that returns a long list of dictionaries. For example, findIndicators returns many indicator properties. Save only value and indicator_type to reduce context size.
For more information, see Cortex XSOAR Transform Language (DT).
Run the following command:
!findIndicators size=2 query="type:IP" raw-response=trueThe response contains two dictionaries with more than 20 items each.
Save only
valueandindicator_typeto theFoundIndicatorscontext key:!findIndicators size=2 query="type:IP" extend-context=`FoundIndicators=.={"value": val.value, "indicator_type": val.indicator_type}`Save only an issue name, status, and ID to the
FoundIssuescontext key:!SearchIssuesV2 id=<ANY_ISSUE_ID> extend-context=`FoundIssues=Contents.data={"name": val.name, "status": val.status, "id": val.id}` ignore-outputs=true
Last updated
Was this helpful?
