Let $M$ be a complete Riemannian manifold with metric $g$. The geodesic flow is the one-parameter family of diffeomorphisms $\phi_t$ on $T^*M$ defined as follows. If $\xi \in T^* M$ is a vector based at $x \in M$, then $\phi_t(\xi) = \gamma'(t)$, where $\gamma$ is the unique geodesic beginning at $x$ with initial velocity $\xi$.
I have read that the geodesic flow is equal to the flow of the Hamiltonian vector field of the function $f$ given in local coordinates by $f(\xi) = |\xi| = \sum_{i=1}^n (g^{ij} \xi_i \xi_j)^{1/2}$. Is this true and if so, how does one prove it?