This is certainly possible. Firstly you would need to decide what Context key name to put them under. After you have decided, generally we use
return_results(command_results)
where "command_results" is a CommandResults object (for which the documentation on how to use it is here
As an example (and assuming you have a scrip that has an argument input called "ips"):
args = demisto.args()
ips = args.get('ips')
if not isinstance(ips, list):
try:
ips = ips.split(",")
except Exception as err:
return_error(f'The provided input was not an array or CSV data:\n\n{err}')
set_count = 10
return_data = []
while len(ips) > set_count:
return_data.append(ips[0: (set_count)])
[ips.pop(0) for x in range(set_count)]
return_data.append(ips)
results = []
set_number = 0
for item in return_data:
results.append(
{
'set': set_number,
'ips': item
})
set_number += 1
command_results = CommandResults(
outputs_prefix='IPSets',
outputs_key_field=['set'],
outputs=results,
readable_output=tableToMarkdown('IPs', results, ['set', 'ips'])
)
return_results(command_results)
The result in the context is an array containing dictionaries. Each dictionary has a set number (to avoid duplicates) and the actual IPs.
I hope this helps.
Regards
Adam