ServerLogs_docker

Uses the ssh integration to grab the host server logs. This script is supported only on Cortex XSOAR on-prem (version 6.X).

python · Common Scripts

Details

IDServerLogs_docker
Languagepython
From Version6.0.0
Docker Imagedemisto/python3:3.12.13.10404775
Tagswidget

README

Uses the ssh integration to grab the host server logs
This script is supported only on Cortex XSOAR on-prem (version 6.X).

Script Data


Name Description
Script Type python3
Tags widget
Cortex XSOAR Version 6.0.0

Inputs


There are no inputs for this script.

Outputs


There are no outputs for this script.

import demistomock as demisto


def test_main(mocker):
    """
    Given:
        - Valid response from ssh command
    When:
        - Running the script
    Then:
        - Ensure results function is called with the expected output
    """
    from ServerLogsDocker import main

    mocker.patch.object(demisto, "executeCommand", return_value=[{"Contents": {"output": "output"}}])
    return_results = mocker.patch.object(demisto, "results")
    main()
    return_results.assert_called_with("File: /var/log/demisto/docker.log\noutput")