Transform Output

New to setting up Transposit? Learn how to get started.

Optionally, use Transposit's transformers to process complex data coming in from external services.

  1. Start Creating a New Action. Select Action in the Script Builder drop-down list.

  2. Select a transformer. Choose the transformation action you need.

    • JMESPath Extractor. Takes an object and a JMESPath search and extracts the relevant data.
    • Regex Search String. Uses regex to search a string.
    • String Mapping. Maps a given input string to an output string, based on configuration.
    • Timestamp Formatting. Converts times to a new format or timezone.

JMESPath Extractor

JMESPath is a query language for JSON that lets you extract and transform elements from a JSON document.

For details on the above, see https://jmespath.org/tutorial.html.

Regex Search String

When you select the regex search string transformer, you can use a subset of Python's re library as an output processor.

The action types supported are the following.

Scans through the string looking for the first location where this regular expression produces a match, and returns a corresponding match object.

In the above example, you can see 'dag_id' as part of the search string that the regex pattern is set to search.

When the script is run with the settings above, the output is as follows.

Match

If zero or more characters at the beginning of the string match this regular expression, returns a corresponding match object.

Sub

Returns the string obtained by replacing the occurrence of a pattern in a string by the replacement string.

For details on each of the above, see https://docs.python.org/3/library/re.html.