Does the prohibition of Loshon Hara apply when the target is an online name or identity, where the person behind it is anonymous, such as an anonymous user on this forum ?
If you don't mention a name and it's not possible (ever) to work out who you are speaking about, then there's no prohibition of Lashon Hara (see Sefer Chofetz Chaim, Hilchos Lashon Hara 3:4, where this is implied).
You are simply giving an example of derogatory behaviour that actually happened, but not slandering someone personally.
In your case the victim is not using his real name, and possibly could never be found out, but you are still referring to a real person and you're not just giving an example of poor behaviour. In my opinion it would still be Lashon Hara.
If you consider this case in terms of identity rather than only name then I think it's clearer you would be slandering an actual person, even though it's through their online identity and you don't even know their real name.
SEFER CHOFETZ CHAIM Day 30 – Without Names
All forms of loshon hora are prohibited even when no names are mentioned, if it will be possible for people to determine who is being discussed.
Furthermore, if names are omitted but the story will reflect badly on an entire group of people, it may not be spoken. Speaking critically about an unnamed student at a yeshiva is often taken as a statement about the entire student body or as a reflection on yeshiva students in general. If this is the implication, the statement is a more serious form of loshon hora, for it reflects on a multitude of Jews.
Regardless of who you are speaking of, or speaking to there is only 2 reasons that it is ever ok to type or speak Lashon Harah what so ever.
Even if you want to say that it is 'ok' to speak lashon harah about some person or some group, it is still not OK because you want to prevent yourself from getting in the habit of speaking Lashon Harah. What if you think the person is in a permissible category, but it turns out that they are actually a prohibited category without you realizing it?
Anyone who says it is ok to speak lashon harah about some group is wrong and or lying. If anything, it's just a different prohibition than the one they think it is.