title: How to sort results from `list-tasks` in aws-cli?
body: <p>I have few tasks running i want to get the latest(task which started last, with last created-at) task arn.
  I am using this command</p>
  
  <pre class="lang-sh prettyprint-override"><code>aws ecs list-tasks --cluster {cluster} --family {family} --desired-status 'STOPPED'
  </code></pre>
  
  <p>after exploring a little i got to know about <code>sort_by</code>. I tried</p>
  
  <pre class="lang-sh prettyprint-override"><code>aws ecs list-tasks --cluster {cluster} --family {family} --desired-status 'STOPPED' --query "sort_by(taskArns, &amp;CreatedAt)"
  </code></pre>
  
  <p>But this gives error </p>
  
  <pre><code>In function sort_by(), invalid type for value: &lt;some_task_arn&gt;, expected one of: ['string', 'number'], received: "null"
  </code></pre>