ConvertResourceAttributesToTable
This script is used to convert CrowdStrike IOM resource attributes to a table.
- Type
- python
- Pack
- CrowdStrikeFalcon
Source
import demistomock as demisto
from CommonServerPython import *
def convert_to_table(context_results: str) -> CommandResults:
"""
Args:
context_results (str): String representing the data of the incident field.
Returns:
CommandResults: CommandResults object containing only readable_output
"""
comment_entries = json.loads(context_results)
md = tableToMarkdown(
name="",
t=comment_entries,
headers=list(comment_entries.keys()),
removeNull=True,
sort_headers=False,
headerTransform=pascalToSpace,
is_auto_json_transform=True,
)
return CommandResults(readable_output=md)
def main(): # pragma: no cover
try:
if context := dict_safe_get(
demisto.callingContext,
["context", "Incidents", 0, "CustomFields", "crowdstrikefalconresourceattributes"],
{},
):
return_results(convert_to_table(context))
else:
return CommandResults(readable_output="No data to present")
except Exception as e:
demisto.error(traceback.format_exc()) # print the traceback
return_error(str(e))
if __name__ in ("__main__", "__builtin__", "builtins"):
main()
README
This script is used to convert CrowdStrike IOM resource attributes to a table.
Script Data
| Name | Description |
|---|---|
| Script Type | python3 |
| Tags | dynamic-section |
| Cortex XSOAR Version | 6.8.0 |
Inputs
There are no inputs for this script.
Outputs
There are no outputs for this script.