ss allows to filter socket states, using keywords state and exclude, followed by some state identifier.
State identifier are standard TCP state names (not listed, they are useless for you if you already do not know them) or abbreviations:
F.e. to dump all tcp sockets except SYN-RECV:
If neither state nor exclude directives are present, state filter defaults to all with option -a or to all, excluding listening, syn-recv, time-wait and closed sockets.