The "cut" command gives you access to a given field -f separated by delimiter -d, your original post said <i>before</i> the | but the rest of the thread it seemed like you wanted everything after the |, hence the -f2 but if you really do want before, just use -f1

So this wouldn't happen in realtime but maybe you could redirect to a new file, run out of crontab or something