We prove a formula for the multiplicities of the index of an equivariant transversally elliptic operator on a G-manifold. The formula is a sum of integrals over blowups of the strata of the group action and also involves eta invariants of associated elliptic operators. Among the applications, we obtain an index formula for basic Dirac operators on Riemannian foliations, a problem that was open for many years