req.esi_level

INTEGER, read-only.

Available inrecvdeliver

Level of ESI subrequest. A value of 0 indicates this is the top-level request. A value of 2 would signify an include within an include.