SplunkConvertNotesToTable

This script is used to convert Splunk notes to a table.

python · Splunk

Details

IDSplunkConvertNotesToTable
Languagepython
From Version6.0.0
Docker Imagedemisto/python3:3.12.13.10404775
Tagsdynamic-section

README

This script converts Splunk notes into a table.```

Script Data


Name Description
Script Type python3
Tags dynamic-section
Cortex XSOAR Version 6.0.0

Inputs


There are no inputs for this script.

Outputs


There are no outputs for this script.

import SplunkConvertNotesToTable

EXPECTED_TABLE = "#### Splunk Notes (1)\n\n--\n\nnew note\n\n"


def test_convert_to_table(mocker):
    """
    Given:
        - A list of notes of a Splunk finding in string format
    When:
        - Calling convert_to_table function
    Then:
        - Validate the table is created correctly
    """
    incident = {"CustomFields": {"splunknotes": ['{"Note":"new note"}']}}
    mocker.patch("demistomock.incident", return_value=incident)
    result = SplunkConvertNotesToTable.main()

    assert result.readable_output == EXPECTED_TABLE