I'm currently redirecting the output of a monitoring tool to a file, however what I'd like to do, is to redirect this output to a new file on my request (using a keybinding), without stopping the said tool.

Something like

 monitor_program | handle_stdout

Where `handle_stdout` allows me to define a new file where to put the log at certain point.

I know I could easily write it, but I'm wondering if there's any tool that already allows this.