StringToArray

Converts string to array. For example: `http://example.com/?score:1,4,time:55` will be transformed to `["http://example.com/?score:1,4,time:55"]`.

python · Filters And Transformers

Details

IDStringToArray
Languagepython
From Version6.0.0
Docker Imagedemisto/python3:3.12.13.10404775
Tagstransformer

README

Converts string to array.
For example: http://example.com/?score:1,4,time:55 will be transformed to ["http://example.com/?score:1,4,time:55"].

Script Data


Name Description
Script Type python3
Tags transformer
Cortex XSOAR Version 6.0.0

Inputs


Argument Name Description
value The URL to transform.

Script Example

!StringToArray value="http://example.com/?score:1,4,time:55"

Human Readable Output

["http://example.com/?score:1,4,time:55"]

from StringToArray import *


def test_string_to_array():
    """Unit test
    Given
    - url to tranform.
    When
    - call StringToArray transformer.
    Then
    - validate The transformed url.
    """
    res = main({"value": "http://example.com/?score:1,4,time:55"})
    assert res == '["http://example.com/?score:1,4,time:55"]'