Skip to main content

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.

This transformer will take in a value and transform it based on multiple condition expressions (wildcard, regex, etc) defined in a JSON dictionary structure.


What does this pack do?
  • Transform a value based on multiple condition expressions defined in a JSON dictionary structure.
  • Condition expressions support wildcard, regex, and literal.

Script Data

Name Description
Script Type python3
Tags transformer, string

Examples

The key:value pair of the JSON dictionary should be:

"condition expression": "desired outcome"

For example:

    {
        ".*match 1.*": "Dest Val1",
        ".*match 2.*": "Dest Val2",
        ".*match 3(.*)": "\\1",
        "*match 4*": {
            "algorithm": "wildcard",
            "output": "Dest Val4"
        }
    }

The transformer will return the value matched to a pattern following to the priority.
When unmatched or the input value is structured (dict or list), it will simply return the input value.

PUBLISHER

Masahiko Inoue

INFO

Supported ByCommunity
CreatedApril 5, 2021
Last ReleaseDecember 5, 2021

DISCLAIMER
Content packs are licensed by the Publisher identified above and subject to the Publisher’s own licensing terms. Palo Alto Networks is not liable for and does not warrant or support any content pack produced by a third-party Publisher, whether or not such packs are designated as “Palo Alto Networks-certified” or otherwise. For more information, see the Marketplace documentation.