Get the last element in JSON file
<p>I have this JSON file:</p>

<pre><code>{
      "system.timestamp": "{system.timestamp}",
      "error.state": "{error.state}",
      "system.timestamp": "{system.timestamp}",
      "error.state": "{error.state}",
       "system.timestamp": "{system.timestamp}",
      "error.state": "{error.state}",
      "error.content": "{custom.error.content}"
}
</code></pre>

<p>I would like to get only the last object of the JSON file as I need to check that in every case, the last object is <code>error.content</code>. Attached part of code is just a sample file, every file that will be generated in reality will contain at least around 40 to 50 objects, so in every case I need to check that the last object is <code>error.content</code>.</p>

<p>I have calculated the length by using <code>jq '. | length'</code>. How do I do it using the <code>jq</code> command in Linux?</p>

<p>Note: it's a plain JSON file without any arrays.</p>