mtr 原始输出的格式是什么?

glu*_*k47 2 bash mtr

我使用 mtr 计算到主机的跃点数并将该数字传递给脚本。我发现了-l(或--raw) 选项,它产生一个准备好解析的输出。但是,我想知道在哪里可以找到这种原始格式描述?不幸的是,man谷歌只给了我这个:

-l

   --raw
          Use  this option to tell mtr to use the raw output format. This format is better suited for archival of the measure?
          ment results. It could be parsed to be presented into any of the other display methods.
Run Code Online (Sandbox Code Playgroud)

Dan*_*ner 6

在他们的源文件中,MTR 有一个名为:FORMATS 的文件

来源

从该文件是摘录:

The "raw" format is:

hostline|xmitline|pingline|dnsline|timestampline|mplsline

hostline:
h <pos> <host IP>

xmitline:
x <pos> <seqnum>

pingline:
p <pos> <pingtime (ms)> <seqnum>

dnsline: 
d <pos> <hostname>

timestampline:
t <pos> <pingtime> <timestamp>

mplsline:
m <pos> <label> <traffic_class> <bottom_stack> <ttl>
Run Code Online (Sandbox Code Playgroud)

解析时,此 <pos> 是主机索引的整数。第一跳的主机为0,第二跳为1,以此类推。另外需要注意的是pingtime的单位是ms,但是是微秒而不是毫秒。