I am not sure if this is what you are up to (it is related to what Xiao-Qi Sun said) to but I'll give it a try too ...
At the beginning of Chapter V.2 of his QFT Nutshell, Anthony Zee explains how classical statistical mechanics (characterized by the corresponding partition function involving the Hamilton function) in $d$- dimensional space is related to Eucledian field theory (characterized by the corresponding generating functional or path integral involving the Lagrangian).
To see this relationship, consider for example the Minkowskian path integral of a scalar field
$$ (1) \,\, \cal{Z} = \int\cal{D}\phi e^{(i/\hbar)\int d^dx[\frac{1}{2}(\partial\phi)^2-V(\phi)]} = \int\cal{D}\phi e^{(i/\hbar)\int d^dx\cal{L}(\phi)} = \int\cal{D}\phi e^{(i/\hbar)S(\phi)} $$
Upon Wick rotation, the Lagrange density $\cal{L}(\phi)$ turns into the energy density and the action $S(\phi)$ gets replaced by the energy functional $\cal E(\phi)$ of the field $\phi$
$$ (2) \,\, \cal{Z} = \int\cal{D}\phi e^{(-1/\hbar)\int d^d_Ex[\frac{1}{2}(\partial\phi)^2+V(\phi)]} = \int\cal{D}\phi e^{(-1/\hbar)\cal{E}(\phi)} $$
with
$$ \cal E(\phi) = \int d^d_Ex[\frac{1}{2}(\partial\phi)^2+V(\phi)] $$
This can now be compared to the classical statistical mechanics of an N-particle system with the Energy
$$ E(p,q) = \sum_i \frac{1}{2m}p_i^2+V(q_1,q_2,\cdots,q_N) $$
and the corresponding partition function
$$ Z = \prod_i\int dp_i dq_i e^{-\beta E(p,q)} $$
Integrating over the momenta $p_i$ one obtains the reduced partition function
$$ Z = \prod_i\int dq_i e^{-\beta V(q_1,q_2,\cdots,q_N)} $$
Following the usual procedure to obtain the field theory which corresponds to this reduced partiction function by letting $i\rightarrow x$, $q_i \rightarrow \phi(x)$ and identifying $\hbar = 1/\beta = k_B T$ it has exactly the same form as the Euclidian path integral (2).
So it can finally be seen that in this example, the (reduced) partition function of an N-particle system in d-dimensional space corresponds to the path integral of a scaler field in d-dimensional spacetime.
These arguments can be further generalized to obtain a path integral representation of the quantum partition funcction, finite temperature Feynman diagrams, etc too ...
If I understand this right, this line of thought relating statistical mechanics to field theory is for example applied in topics like the Nonequilibrium functional renormalization group or in AdS/CFT to relate the correlation functions on the CFT side to the string amplitudes on the AdS side.