ChangeContext

Enables changing context in two ways. The first is to capitalize the first letter of each key in following level of the context key entered. The second is to change context keys to new values.

python · Common Scripts

Details

IDChangeContext
Languagepython
From Version5.0.0
Docker Imagedemisto/python3:3.12.13.10404775
TagsUtility

README

Enables changing context in two ways. The first is to capitalize the first letter of each key in following level of the context key entered. The second is to change context keys to new values.

Script Data


Name Description
Script Type python3
Tags Utility
Cortex XSOAR Version 5.0.0

Used In


This script is used in the following playbooks and scripts.

  • QRadar - Get Offense Logs
  • QRadar - Get offense correlations v2
  • QRadarCorrelationLog
  • SafeBreach - Compare and Validate Insight Indicators

Inputs


Argument Name Description
input The context to change (i.e., ${Context.Key}).
inplace If “True” replaces the existing key. The default is “True”.
replace_dict A list of key-values to replace key for value in the following format: {“old_key1”:”new_key1”, “old_key2”:”new_key2”}
capitalize If “True” capitalizes the first letter of the context key.
output_key The context path in which to output the results. Should be in the format of Context.Key.

Outputs


There are no outputs for this script.

args:
- description: The context to change (i.e., ${Context.Key}).
  name: input
- auto: PREDEFINED
  defaultValue: 'True'
  description: If "True" replaces the existing key. The default is "True".
  name: inplace
  predefined:
  - 'True'
  - 'False'
- description: 'A list of key-values to replace key for value in the following format: {"old_key1":"new_key1", "old_key2":"new_key2"}.'
  name: replace_dict
- auto: PREDEFINED
  defaultValue: 'False'
  description: If "True" capitalizes the first letter of the context key.
  name: capitalize
  predefined:
  - 'True'
  - 'False'
- description: The context path in which to output the results. Should be in the format of Context.Key.
  name: output_key
  required: true
comment: 'Enables changing context in two ways. The first is to capitalize the first letter of each key in following level of the context key entered. The second is to change context keys to new values. '
commonfields:
  id: ChangeContext
  version: -1
enabled: true
name: ChangeContext
script: '-'
timeout: '0'
type: python
dockerimage: demisto/python3:3.12.13.10404775
runas: DBotWeakRole
subtype: python3
fromversion: 5.0.0
tags:
- Utility
tests:
- No tests (auto formatted)