usecase

The concern is documenting characters that have started to bug me when checking Nomad allocation logs initially.

module.redshift.module.cluster.aws_redshift_cluster.cluster[0]: Still modifying... 
  • what are these characters [ ?

This would not be a problem is that is piped into out-host

module.redshift.module.cluster.aws_redshift_cluster.cluster[0]: 

1. notes

  • there are TERMINAL CONTROL CHARACTERS
  • in other places, this can be fixed by removing colors
  • for nomad, however, even running with nomad alloc logs -no-color _ALLOC_ID_ does not change it
  • i have to pipe it to out-host cmdlet (alias oh) to make it work again
nomad alloc logs -no-color _ALLOC_ID_ | oh

2. function alias to make this fast

  • this is now living in my $profile
function get-nomadLogs ($jobId, $paging) { 
    $nomadLogs = nomad alloc logs -job $jobId 
    if ($paging) { oh -InputObject $nomadLogs -Paging }
    else { oh -InputObject $nomadLogs }
}
Set-Alias n get-nomadLogs
  • specific for this is that I am getting a job id from the slack bot (running jobs )

3. sources