How to filter out backend and frontend separated events when javascript are on both backend and frontend

Our web application are implemented javascript on backend and frontend. I knows there is logger filter to filter javascript but this is only for front end.
Wonder if there a way for me to filer our only for backend events.