Open jasonliao opened 6 years ago
I found some of ps -lx log crash the output
ps -lx
import Parser from 'table-parser' const log = ` F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND 1 1000 22896 1 20 0 862556 2020 hrtime Ss ? 0:44 /home/user/server/sbin/agent -i /home/user/server/etc/agent.conf -d ` console.log(Parser.parse(log)) // work perfect!
but when I add a log below, the output getting odd...
1 1000 37155 37142 20 0 1418072 613332 hrtime Sl ? 11719:38 /home/user/sbin/otherAgent -i /home/user/etc/otherAgent.conf
import Parser from 'table-parser' const new_log = ` F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND 1 1000 22896 1 20 0 862556 2020 hrtime Ss ? 0:44 /home/user/server/sbin/agent -i /home/user/server/etc/agent.conf -d 1 1000 37155 37142 20 0 1418072 613332 hrtime Sl ? 11719:38 /home/user/sbin/otherAgent -i /home/user/etc/otherAgent.conf ` console.log(Parser.parse(new_log)) /* { COMMAND: ["0:44", "/home/user/server/sbin/agent"], TIME: ["0:44", "/home/user/server/sbin/agent", "-i", "/home/user/server/etc/agent.conf", "-d"] } */
here is demo
table-parser v1.0.1
Happened to me as well, I think it's when the running time of a process reaches 5 digits causing a shift between time/command column.
I found some of
ps -lx
log crash the outputbut when I add a log below, the output getting odd...
here is demo
table-parser v1.0.1