In this paper, we study relations between Langlands L-functions and zeta functions of geodesic walks and galleries for finite quotients of the apartments of G =PGL 3 and PGSp 4 over a nonarchimedean local field with q elements in its residue field. They give rise to an identity (Theorem 5.3) which can be regarded as a generalization of Ihara's theorem for finite quotients of the Bruhat-Tits trees. This identity is shown to agree with the q = 1 version of the analogous identities for finite quotients of the building of G established in [KL14, KLW10, FLW13], verifying the philosophy of the field with one element by Tits. A new identity for finite quotients of the building of PGSp 4 involving the standard L-function (Theorem 6.3), complementing the one in [FLW13] which involves the spin L-function, is also obtained. 6