jq (which does not care whether the input is in compact or multi-line form):
your-command | jq -r '..rows._uuid'
Your JSON document is an array consisting of objects and you want the first of these top-level objects,
.. That object contains a
rows array, and you want the first of its elements,
.rows. That element has another array called
_uuid, and you want that array's second element,
-r you get the decoded, "raw", data back. Without
-r, you get a (quoted) JSON string.
A totally different way of getting the data from this particular JSON document would be to get the last value in the document:
your-comand | jq -r 'getpath([paths(scalars)][-1])'
This first generates all "paths" for each scalar value in the whole document with
paths, and picks out the last of them. The expression then uses this path-of-the-last-scalar with
getpath to pull out the last value. For the given document, this results in the expected output.
The following is probably doing the same thing, but with explicit recursion using
.. and with
select() to pull out all scalar values:
your-command | jq -r '[.. | select(scalars)][-1]'
Personally, I would go with the topmost suggestion in this answer, as it uses the structure of the document, which is bound to be meaningful to the user in some way. That code would have to be revisited, and the question reformulated, if any of the involved arrays starts containing more elements.