For the complete documentation index, see llms.txt. This page is also available as Markdown.
Cortex XSOAR 6.xCortex XSOAR 8 (SaaS)Cortex XSOAR 8.x (On-premCortex XSIAM

run

Run Cortex XSOAR integrations and scripts locally with the Demisto SDK.

This command enables you to run integration or script commands in the Playground of a remote Cortex XSOAR/XSIAM instance and pretty print the output. This is useful when developing new commands or fixing bugs, because it lets you debug the code directly from the CLI and optimize the development process flow.

The run command requires interactions with Cortex XSIAM or Cortex XSOAR. Before you use the command, verify you have set up the environment variables.

Arguments
Argument
Description

-q QUERY, --query QUERY

The query to run.

--insecure

Skips certificate validation.

--json-to-outputs

Whether to run json-to-outputs command on the context output of the query. If the context output does not exist or the -r flag is used, uses the raw response of the query.

-p, --prefix

Used with json-to-outputs flag. Output prefix e.g. Jira.Ticket, VirusTotal.IP, the base path for the outputs that the script generates.

-r, --raw-response

Used with json-to-outputs flag. Use the raw response of the query for json-to-outputs.

-D, --debug

Whether to enable the debug-mode feature. If you want to save the output file, use the --debug-path option.

--debug-path PATH\_TO\_FILE

The path where you want to save the debug file. If not specified, the debug file prints to the terminal.

Examples

Note

The ! character is not mandatory; it is added automatically if needed. Either double quotes " or single quotes ' can be used to wrap the query.

  • demisto-sdk run -q 'ip ip="8.8.8.8"'

    Runs the query !ip ip="8.8.8.8" on the playground of the Cortex XSOAR pr Cortex XSIAM instance and prints the output.

  • demisto-sdk run -q "panorama-list-address-groups"

    Runs the query !panorama-list-address-groups on the playground of the Cortex XSOAR or Cortex XSIAM instance and prints the output.

  • demisto-sdk run -q '!gct-translate-text text="ciao" target="iw"'

    Runs the query !gct-translate-text text="ciao" target="iw" on the playground of the Cortex XSOAR or Cortex XSIAM instance and prints the output.

  • demisto-sdk run -q '!gct-translate-text text="ciao" target="iw"' -k

    Runs the query !gct-translate-text text="ciao" target="iw" on the playground of the Cortex XSOAR or Cortex XSIAM instance without certificate validation, and prints the output.

  • demisto-sdk run -q '!gct-translate-text text="ciao" target="iw"' -v

    Runs the query !gct-translate-text text="ciao" target="iw" on the playground of the Cortex XSOAR or Cortex XSIAM instance, prints the output and additional meta-data.

  • demisto-sdk run -q '!gct-translate-text text="ciao" target="iw"' -D

    Runs the query !gct-translate-text text="ciao" target="iw" in debug mode (with debug-mode="true") on the playground of the Cortex XSOAR or Cortex XSIAM instance, prints the output, retrieves the debug log file and pretty prints it.

  • demisto-sdk run -q '!gct-translate-text text="ciao" target="iw"' -D --debug-path output.log

    Runs the query !gct-translate-text text="ciao" target="iw" in debug mode (with debug-mode="true") on the playground of the Cortex XSOAR or Cortex XSIAM instance, prints the output and creates the output.log file that contains the command debug logs.

Last updated

Was this helpful?