RSA_DisplayMetasEvents

Use this script to display meta events inside the layout.

python · NetWitness

Details

IDRSA_DisplayMetasEvents
Languagepython
From Version6.9.0
Docker Imagedemisto/python3:3.12.13.10116658
Tagsdynamic-section

README

Use this script to display meta events inside the layout.

Script Data


Name Description
Script Type python3
Tags dynamic-section

Inputs


There are no inputs for this script.

Outputs


There are no outputs for this script.

Script Examples

Example command


### Context Example

```json
 {
    "Metas Events": [
        {
            "meta1": "value meta 1",
            "meta2": "value meta 2",
            "meta3": "value meta 3",
            "id": "dummy_id",
            "riskScore": "50",
            "source": "NetWitness Investigate",
            "title": "sk_test300",
            "type": "Log",
        }
    ]
}

Human Readable Output

|meta1|meta2|meta3|
|---|---|---|
| value meta 1 | value meta 2 | value meta 3 |
import pytest
from RSADisplayMetasEvents import CamelCaseToDotCase, display_metas


def test_CamelCaseToDotCase():
    assert CamelCaseToDotCase("eventSource") == "event.source"


@pytest.mark.parametrize(
    "alerts_incident, expected_results",
    [
        (
            {"CustomFields": {"rsametasevents": [{"ip": "ip", "host": "host"}]}},
            {"Contents": "|ip|host|\n|---|---|\n| ip | host |\n", "ContentsFormat": "markdown", "Type": 1},
        ),
    ],
)
def test_display_metas(mocker, alerts_incident, expected_results):
    mocker.patch("RSADisplayMetasEvents.demisto.incident", return_value=alerts_incident)
    assert display_metas() == expected_results