DumpJSON

Dumps a json from context key input, and returns a json object string result.

python · Common Scripts

Details

IDDumpJSON
Languagepython
From Version5.0.0
Docker Imagedemisto/python3:3.12.13.10404775
TagsUtility

README

Dumps a JSON from the context key input, and returns a JSON object string result.

Script Data


Name Description
Script Type python3
Tags Utility

Inputs


Argument Name Description
key The context path to the JSON object.

Outputs


Path Description Type
JsonStr The JSON object as a string. Unknown
import json

import demistomock as demisto  # noqa: F401
from CommonServerPython import *  # noqa: F401


def main():
    key = demisto.args()["key"]
    obj_str = json.dumps(demisto.get(demisto.context(), key))
    demisto.setContext("JsonStr", obj_str)
    return_results(obj_str)


if __name__ in ("__main__", "__builtin__", "builtins"):
    main()