Pack Contributors:
- Samuel Kamar
- Masahiko Inoue
- Jaden Evanger
- Mandar Naik
- Ryan McVicar
Contributions are welcome and appreciated. For more info, visit our Contribution Guide.
Frequently used filters and transformers pack.
Contributions are welcome and appreciated. For more info, visit our Contribution Guide.
Contributions are welcome and appreciated. For more info, visit our Contribution Guide.
| Name | Description |
|---|---|
| SetIfEmpty | Checks an object for an empty value and returns a pre-set default value. |
| PadZeros | Adds zeros (0) to the beginning of the string, until the string reaches the specified length. |
| RemoveMatches | Removes items from the given list of values if they match any of the patterns in the provided |
| BeforeRelativeDate | Checks the given datetime has occured before the provided relative time. |
| ParseHTMLTables | Find tables inside HTML and extract the contents into objects using the following logic:
|
| LowerCidrNumAddresses | Check if number of availble addresses in IPv4 CIDR is lower than given number. |
| ProductJoin | Returns the product of two lists, joined by a separator, as a list of strings. |
RegexGroups | Extraction of elements which are contained in all the subgroups of the match to the pattern. |
| InRange | checks if left side is in range of right side (from,to anotation) |
| AppendIfNotEmpty | Append item(s) to the end of the list if they are not empty. |
| RemoveNullBytes | Removes null bytes from string. |
| BetweenDates | Whether value is within a date range. |
| GetRange | Gets specified indexes of a list. |
| AfterRelativeDate | Checks the given datetime has occured after the provided relative time. |
| FormatTemplate | Build text from a template that can include DT expressions. |
| EmailDomainBlacklist | Accepts an array of domains as a block list, and a list of email addresses. The script then filters out any email address whose domain is in the block list. The filtered list will be returned as an array. |
| BetweenHours | Checks whether the given value is within the specified time (hour) range. |
| StringifyArray | Return the string encoded with JSON from the whole array |
| MapPattern | This transformer will take in a value and transform it based on multiple condition expressions (wildcard, regex, etc) defined in a JSON dictionary structure. The key:value pair of the JSON dictionary should be: "condition expression": "desired outcome" For example: { The transformer will return the value matched to a pattern following to the priority. |
| MergeDictArray | Each entry in an array is merged into the existing array if the keyed-value matches. |
| RegexExpand | Extract the strings matched to the patterns by doing backslash substitution on the template string. |
| URLDecode | Converts |
| URLEncode | Encodes a URL string by replacing special characters in the string using the %xx escape. For example: https://example.com converts to https:%2F%2Fexample.com. |
| WhereFieldEquals | Return all items from the list where their given 'field' attribute is equal to 'equalTo' argument E.g. !WhereFieldEquals with the following arguments:
Will return all items names where field 'type' equals 'IP' - ['192.1,0.82', '172.0.0.2']. |
| ExtractEmailTransformer | Extracts email addresses from the given value. |
| EmailDomainWhitelist | Accepts an array of domains as an allow list, and a list of email addresses. The script then filters out any email address whose domain is not in the allow list. The filtered list will be returned as an array. |
| MapRangeValues | This script converts an input value into another value using two lists. The input value or range is searched in the first list (map_from). Example 1: map_from = "1,2,3,4" Output is "2" Example 2: map_from = "1-3,4" Output is "5". |
| CheckIfSubdomain | Checks whether a given domain is a subdomain of one of the listed domains. |
| ReverseList | Reverse a list This is an example for entire-list transformer - it operates the argument as a list (note the "entirelist" tag). |
| LastArrayElement | Returns the last element of an array. If the value passed is not an array, it returns the original value that was passed. |
| Base64Decode | Decodes an input in Base64 format. |
| IgnoreFieldsFromJson | Removed selected fields from the JSON object. |
| SortBy | This transformer will sort an array of dictionary values by keys in ascending or descending order. |
| SumList | Sums a List This is an example for number transformer. |
| CIDRBiggerThanPrefix | Checks whether a given CIDR prefix is bigger than the defined maximum prefix. |
| IsRFC1918Address | A filter that receives a single IPv4 address string as an input and determines whether it is in the private RFC-1918 address space (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16). For more information, see https://en.wikipedia.org/wiki/Private_network |
| AnyMatch | Returns all elements from the left side that have a substring that is equal to an element from the right side. Note: This filter is case-insensitive. |
| RegexExtractAll | Extraction of all matches from a specified regular expression pattern from a provided string. Returns an array of results. This differs from RegexGroups in several ways:
|
| IPv4Whitelist | Transformer that returns a filtered list of IPv4 addresses, based on whether they match a comma-separated list of IPv4 ranges. Useful for filtering in internal IP address space. |
| TimeComponents | Takes a date or time input and get time components in a specific time zone.
|
| StringContainsArray | Checks whether a substring or an array of substrings is within a string array(each item will be checked). Supports single strings as well. For example, for substrings ['a','b','c'] in a string 'a' the script will return true. |
| GetListContent | Returns the content of the List with the given Name as a string or JSON object, depending on the selected |
| DateStringToISOFormat | This is a thin wrapper around the |
| StringToArray | Converts string to array. |
| GreaterCidrNumAddresses | Check if number of availble addresses in IPv4 or IPv6 CIDR is greater than given number. |
| DT | This automation allows the usage of DT scripts within playbooks transformers. |
| IsInCidrRanges | Determines whether an IPv4 or IPv6 address is contained in at least one of the comma-delimited CIDR ranges. Multiple IPv4/IPv6 addresses can be passed comma-delimited and each will be tested. A mix of IPv4 and IPv6 addresses will always return false. |
| Cut | Cut a string by delimiter and return specific fields. Exampleinput: "A-B-C-D-E" return: "A-E". |
| If-Elif | A transformer for if-elif-else logic. |
| If-Then-Else | A transformer for simple if-then-else logic. |
| DedupBy | This transformer will remove elements of the array that contain an identical combination of values for the keys given. |
| JsonToTable | Accepts a json object and returns a markdown. Supports clickable links. |
| TimeStampToDate | Converts UNIX Epoch time stamp to a simplified extended ISO format string. Use it to convert time stamp to Demisto date field e.g. 1525006939 will return '2018-04-29T13:02:19.000Z' |
| RemoveEmpty | Remove empty items, entries or nodes from the array. |
| ParseJSON | Parse a given JSON string "value" to a representative object. Example: '{"a": "value"}' => {"a": "value"}. |
| GetValuesOfMultipleFields | The script receives a list of fields and a context key base path. For example, Key=Test.result List=username,user gets all of the values from Test.result.username and Test.result.user. |
| RegexReplace | Format patterns matched with regex. If the regex does not match any pattern, the original value is returned. Example 1: Example 2: |
| FormattedDateToEpoch | Converts a custom-formatted timestamp to UNIX epoch time. Use it to convert custom time stamps to a XSOAR date field. If you pass formatter argument, we will use it to transform. If not, we will use dateparser.parse for transforming. For more info, see: https://docs.python.org/3.7/library/datetime.html#strftime-and-strptime-behavior |
| ConcatFormat | Returns a string concatenated with given a prefix and suffix which supports DT expressions. |
| FirstArrayElement | Returns the first element of an array. If the value passed is not an array, it returns the original value that was passed. |
| MapValuesTransformer | This script converts the input value into another value using two lists. The input value is searched in the first list (input_values). Example 1: input_values = "1,2,3,4" Output would be "2" Example 2: input_values ="firstkey: datahere,secondkey: datathere" Output would be: The reason for matching the key AND value pair in a dictionary is to allow the mappig of values that have a specific key name. In most cases, dictionaries will continan key-value pairs in which the values are the same. You might want to change the value of KeyA, but not the value of KeyB. This method gives control over which key is changed. When the input is a dict, str , int, or list, the output is ALWAYS returned as a string. |
| JoinIfSingleElementOnly | Return the single element in case the array has only 1 element in it, otherwise return the whole array. |
| ModifyDateTime | Takes a date or time input and adds or subtracts a determined amount of time. Returns a string in date or time in ISO Format. |
| jmespath | Performs a JMESPath search on an input JSON format, when using a transformer. |
| MakePair | This transformer will create a list of dictionary by aggregating elements from two arrays. |
| ConvertAllExcept | Convert all chosen values but exceptions. |
| ConvertKeysToTableFieldFormat | Convert object keys to match table keys. |
| StripChars | Strip set of characters from prefix and/or suffix |
| IPv4Blacklist | Transformer that returns a filtered list of IPv4 addresses, based on whether they do not match a comma-separated list of IPv4 ranges. Useful for filtering out internal IP address space. |
| ExtractInbetween | Extract a string from an existing string. |
| IsNotInCidrRanges | Checks whether an IPv4 or IPv6 address is not contained in one or more comma-delimited CIDR ranges. |
| ArrayAnyMatch | Returns true if an element is shared between two lists. |
| ConvertToSingleElementArray | Converts a single string to an array of that string. |
| Name | Description |
|---|---|
| ConcatFormat | Returns a string concatenated with given a prefix and suffix which supports DT expressions. |
| IPv4Blacklist | Transformer that returns a filtered list of IPv4 addresses, based on whether they do not match a comma-separated list of IPv4 ranges. Useful for filtering out internal IP address space. |
| AnyMatch | Returns all elements from the left side that have a substring that is equal to an element from the right side. Note: This filter is case-insensitive. |
| BetweenHours | Checks whether the given value is within the specified time (hour) range. |
| GreaterCidrNumAddresses | Check if number of availble addresses in IPv4 or IPv6 CIDR is greater than given number. |
| IsNotInCidrRanges | Checks whether an IPv4 or IPv6 address is not contained in one or more comma-delimited CIDR ranges. |
| Cut | Cut a string by delimiter and return specific fields. Exampleinput: "A-B-C-D-E" return: "A-E". |
| TimeComponents | Takes a date or time input and get time components in a specific time zone.
|
| ArrayAnyMatch | Returns true if an element is shared between two lists. |
| LowerCidrNumAddresses | Check if number of availble addresses in IPv4 CIDR is lower than given number. |
| URLDecode | Converts |
| StringContainsArray | Checks whether a substring or an array of substrings is within a string array(each item will be checked). Supports single strings as well. For example, for substrings ['a','b','c'] in a string 'a' the script will return true. |
| GetValuesOfMultipleFields | The script receives a list of fields and a context key base path. For example, Key=Test.result List=username,user gets all of the values from Test.result.username and Test.result.user. |
| DateStringToISOFormat | This is a thin wrapper around the |
| SortBy | This transformer will sort an array of dictionary values by keys in ascending or descending order. |
| MapPattern | This transformer will take in a value and transform it based on multiple condition expressions (wildcard, regex, etc) defined in a JSON dictionary structure. The key:value pair of the JSON dictionary should be: "condition expression": "desired outcome" For example: { The transformer will return the value matched to a pattern following to the priority. |
| JsonToTable | Accepts a json object and returns a markdown. Supports clickable links. |
| SetIfEmpty | Checks an object for an empty value and returns a pre-set default value. |
| GetListContent | Returns the content of the List with the given Name as a string or JSON object, depending on the selected |
| ExtractInbetween | Extract a string from an existing string. |
| BeforeRelativeDate | Checks the given datetime has occured before the provided relative time. |
| CheckIfSubdomain | Checks whether a given domain is a subdomain of one of the listed domains. |
| If-Elif | A transformer for if-elif-else logic. |
| StringToArray | Converts string to array. |
| MapValuesTransformer | This script converts the input value into another value using two lists. The input value is searched in the first list (input_values). Example 1: input_values = "1,2,3,4" Output would be "2" Example 2: input_values ="firstkey: datahere,secondkey: datathere" Output would be: The reason for matching the key AND value pair in a dictionary is to allow the mappig of values that have a specific key name. In most cases, dictionaries will continan key-value pairs in which the values are the same. You might want to change the value of KeyA, but not the value of KeyB. This method gives control over which key is changed. When the input is a dict, str , int, or list, the output is ALWAYS returned as a string. |
| JoinIfSingleElementOnly | Return the single element in case the array has only 1 element in it, otherwise return the whole array. |
| FormatTemplate | Build text from a template that can include DT expressions. |
| RemoveMatches | Removes items from the given list of values if they match any of the patterns in the provided |
| ParseHTMLTables | Find tables inside HTML and extract the contents into objects using the following logic:
|
| WhereFieldEquals | Return all items from the list where their given 'field' attribute is equal to 'equalTo' argument E.g. !WhereFieldEquals with the following arguments:
Will return all items names where field 'type' equals 'IP' - ['192.1,0.82', '172.0.0.2']. |
| ExtractEmailTransformer | Extracts email addresses from the given value. |
| EmailDomainBlacklist | Accepts an array of domains as a block list, and a list of email addresses. The script then filters out any email address whose domain is in the block list. The filtered list will be returned as an array. |
RegexGroups | Extraction of elements which are contained in all the subgroups of the match to the pattern. |
| ConvertKeysToTableFieldFormat | Convert object keys to match table keys. |
| Base64Decode | Decodes an input in Base64 format. |
| DedupBy | This transformer will remove elements of the array that contain an identical combination of values for the keys given. |
| If-Then-Else | A transformer for simple if-then-else logic. |
| RegexReplace | Format patterns matched with regex. If the regex does not match any pattern, the original value is returned. Example 1: Example 2: |
| ConvertAllExcept | Convert all chosen values but exceptions. |
| FirstArrayElement | Returns the first element of an array. If the value passed is not an array, it returns the original value that was passed. |
| RegexExtractAll | Extraction of all matches from a specified regular expression pattern from a provided string. Returns an array of results. This differs from RegexGroups in several ways:
|
| ProductJoin | Returns the product of two lists, joined by a separator, as a list of strings. |
| ReverseList | Reverse a list This is an example for entire-list transformer - it operates the argument as a list (note the "entirelist" tag). |
| FormattedDateToEpoch | Converts a custom-formatted timestamp to UNIX epoch time. Use it to convert custom time stamps to a XSOAR date field. If you pass formatter argument, we will use it to transform. If not, we will use dateparser.parse for transforming. For more info, see: https://docs.python.org/3.7/library/datetime.html#strftime-and-strptime-behavior |
| URLEncode | Encodes a URL string by replacing special characters in the string using the %xx escape. For example: https://example.com converts to https:%2F%2Fexample.com. |
| MapRangeValues | This script converts an input value into another value using two lists. The input value or range is searched in the first list (map_from). Example 1: map_from = "1,2,3,4" Output is "2" Example 2: map_from = "1-3,4" Output is "5". |
| DT | This automation allows the usage of DT scripts within playbooks transformers. |
| EmailDomainWhitelist | Accepts an array of domains as an allow list, and a list of email addresses. The script then filters out any email address whose domain is not in the allow list. The filtered list will be returned as an array. |
| jmespath | Performs a JMESPath search on an input JSON format, when using a transformer. |
| AppendIfNotEmpty | Append item(s) to the end of the list if they are not empty. |
| ModifyDateTime | Takes a date or time input and adds or subtracts a determined amount of time. Returns a string in date or time in ISO Format. |
| InRange | checks if left side is in range of right side (from,to anotation) |
| PadZeros | Adds zeros (0) to the beginning of the string, until the string reaches the specified length. |
| LastArrayElement | Returns the last element of an array. If the value passed is not an array, it returns the original value that was passed. |
| AfterRelativeDate | Checks the given datetime has occured after the provided relative time. |
| IsInCidrRanges | Determines whether an IPv4 or IPv6 address is contained in at least one of the comma-delimited CIDR ranges. Multiple IPv4/IPv6 addresses can be passed comma-delimited and each will be tested. A mix of IPv4 and IPv6 addresses will always return false. |
| IsRFC1918Address | A filter that receives a single IPv4 address string as an input and determines whether it is in the private RFC-1918 address space (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16). For more information, see https://en.wikipedia.org/wiki/Private_network |
| StripChars | Strip set of characters from prefix and/or suffix |
| GetRange | Gets specified indexes of a list. |
| RemoveNullBytes | Removes null bytes from string. |
| IgnoreFieldsFromJson | Removed selected fields from the JSON object. |
| ConvertToSingleElementArray | Converts a single string to an array of that string. |
| CIDRBiggerThanPrefix | Checks whether a given CIDR prefix is bigger than the defined maximum prefix. |
| RemoveEmpty | Remove empty items, entries or nodes from the array. |
| StringifyArray | Return the string encoded with JSON from the whole array |
| SumList | Sums a List This is an example for number transformer. |
| BetweenDates | Whether value is within a date range. |
| TimeStampToDate | Converts UNIX Epoch time stamp to a simplified extended ISO format string. Use it to convert time stamp to Demisto date field e.g. 1525006939 will return '2018-04-29T13:02:19.000Z' |
| ParseJSON | Parse a given JSON string "value" to a representative object. Example: '{"a": "value"}' => {"a": "value"}. |
| IPv4Whitelist | Transformer that returns a filtered list of IPv4 addresses, based on whether they match a comma-separated list of IPv4 ranges. Useful for filtering in internal IP address space. |
| MakePair | This transformer will create a list of dictionary by aggregating elements from two arrays. |
| MergeDictArray | Each entry in an array is merged into the existing array if the keyed-value matches. |
| RegexExpand | Extract the strings matched to the patterns by doing backslash substitution on the template string. |
| Pack Name | Pack By |
|---|---|
| Base | By: Cortex XSOAR |
| Pack Name | Pack By |
|---|
| Pack Name | Pack By |
|---|---|
| Base | By: Cortex XSOAR |
| Aggregated Scripts | By: Cortex XSOAR |
| Certification | Certified | Read more |
| Supported By | Cortex | |
| Created | January 4, 2022 | |
| Last Release | March 22, 2026 |