Collate results from task console script to one spreadsheet

Can I collate into a single spreadsheet the results of a task console script run against multiple targets?

Create console script task
select several target machines
script runs against those targets

result of each script appended to a single object / file
that single file attached to task

Hi @priddell,

Firstly, let me welcome you to the Octopus community, it is great to see you here :wave:

Can I ask what information you are trying to collate from Octopus here? Just to help me fully understand, it would be good to know in a little more detail your end goal here to see if we can help with a Solution.

In terms of Octopus, maybe you could think about storing your results in Output Variables within your process and in particular for your question Output Variables for Multiple Deployment Targets and then look to append your results into a CSV file.

Out of curiosity, where are you running your scripts within Octopus, are you using Runbooks, Deployment Process or the Script console? I am assuming the Script Console as you mentioned console script, but wanted to double check.

I look forward to hearing from you.

All the best,
Doug

Hi Doug,

In this case I’m running an sql query against a local db to collect the last ticket number from a lot of machines and would like to collate them all into a single spreadsheet. Don’t want to burn out my gaming finger copying and pasting :slight_smile:

Rights within Octopus are siloed in my org and there is no chance I’ll get access to do more than run console scripts. Can I still do this with only console scripts?

Hi @priddell,

Thank you for getting back to me.

I just wanted to make sure that we are on the same page when you are referencing “Console Scripts” you are referring to the “Script Console” within Octopus?

If I am being upfront, using the Script Console for your task, you may find your limitations (which I think you may have already) trying to achieve this. The Script Console is effectively a session run on each of your workers, targets or your Octopus server, similar as if you are running a PowerShell session. Depending on what you have selected, the Script Console will create a session on each machine, so there is not a simple way to do this using the Script Console.

If you needed to do this within Octopus using the Script Console, the only way I can currently think to do this is get Octopus to store the results into a CSV on each target and use another process (outside Octopus if you are limited to only use the Script Console) to collect the files and run another script/process to consolidate this.

I appreciate that you may be limited with your Octopus access, but I feel that a Runbook may be a better alternative here as you could take better advantage of using output variables and using a process to help automate this.

Regards
Doug