Filamentary structures are ubiquitous in astrophysics and are observed at various scales. On a cosmological scale, matter is usually distributed along filaments, and filaments are also typical features of the interstellar medium. Within a cosmic filament, matter can contract and form galaxies, whereas an interstellar gas filament can clump into a series of bead-like structures that can then turn into stars. To investigate the growth of such instabilities, we derive a local dispersion relation for an idealized self-gravitating filament and study some of its properties. Our idealized picture consists of an infinite self-gravitating and rotating cylinder with pressure and density related by a polytropic equation of state. We assume no specific density distribution, treat matter as a fluid, and use hydrodynamics to derive the linearized equations that govern the local perturbations. We obtain a dispersion relation for axisymmetric perturbations and study its properties in the (k R , k z ) phase space, where k R and k z are the radial and longitudinal wavenumbers, respectively. While the boundary between the stable and unstable regimes is symmetrical in k R and k z and analogous to the Jeans criterion, the most unstable mode displays an asymmetry that could constrain the shape of the structures that form within the filament. Here the results are applied to a fiducial interstellar filament, but could be extended for other astrophysical systems, such as cosmological filaments and tidal tails.