I'm guessing you are wondering what the worst problem could be, and if it is worth trying.
Here's some things to think about...
Assuming that the filter is clean inside, the problem I see is that after the rust is gone there is still etching into bottom of the O ring groove, so maybe an O ring will seal there and maybe not. With O rings it is hard to be sure.
If that rusty filter is the positive pressure HST charge filter - it might be worth the risk; a leak there is not a killer problem. HST filters run under some positive pressure, so if it doesn't seal then all that happens is hydraulic fluid leaks out....which you can see on the case and ground and decide if that is something you want to put up with or not.
OTOH, if we are looking at the main suction filter on the feed line from the sump up to the main hydraulic pump - then if that O ring doesn't seal it won't leak much or any fluid out, instead it will suck air into the hydraulic fluid. Too much entrained air in the hydraulic fluid is harder to diagnose and more damaging to the pump and control system.