How tall are the monoliths? Here is an example of an input of monoliths. There are 4 in this example.
  _
 | |        _
 | |  _    | |
 | | | |   | |     _
_| |_| |___| |____| |_

The first monolith is 4 units high, the second is 2, the third is 3, and the last is 1.
The task
Your program should output the heights of the monoliths in order from left to right. The output format can be in any sort of list or array.
Notes

The input can be taken as any dimensional string, list of strings, or list of characters.
This is code-golf, so lowest bytes wins.
You are to assume that monoliths always have the same width, and are always at least 1 _ away from another.
They can come in any height, and in any quantity.

I/O
  _
 | |        _
 | |  _    | |
 | | | |   | |     _
_| |_| |___| |____| |_   &gt;&gt; [4,2,3,1]

           _
          | |
  _       | |
 | |  _   | |  _
_| |_| |__| |_| |_   &gt;&gt; [2,1,4,1]


 _   _   _ 
| |_| |_| |_____   &gt;&gt; [1,1,1]

____________________   &gt;&gt; undefined behavior

 _
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |   &gt;&gt; [11]

     _       _       _       _       _
 _  | |  _  | |  _  | |  _  | |  _  | |
| |_| |_| |_| |_| |_| |_| |_| |_| |_| |  &gt;&gt; [1,2,1,2,1,2,1,2,1,2]
Jelly, (8?) 9 bytes

Ỵ=”|Sḟ0m2


A monadic link accepting a list of characters as specified and returning a list of integers.

Note: 8 bytes if a list of strings, one per line, was really intended to be an allowed input format - just remove the Ỵ.

Try it online!

How?

Ỵ=”|Sḟ0m2 - Link: list of characters, s
Ỵ         - split at newlines
  ”|      - literal '|'
 =        - equals (vectorises)
    S     - sum (vectorises, hence counts the number of '|' in every column)
     ḟ0   - filter out zeros (only keep the results from the sides of the towers)
       m2 - modulo index with 2 (keep only the left side measurements)