traviscross / mtr

Official repository for mtr, a network diagnostic tool
http://www.bitwizard.nl/mtr/
GNU General Public License v2.0
2.64k stars 337 forks source link

AS Lookup for JSON output #419

Open thetechcatalyst opened 2 years ago

thetechcatalyst commented 2 years ago

When using the Autonomous System (AS) number lookup option (-z) with JSON output the AS information is not listed... To be fair I won't rule out user error however I have not found the option documented another way...

mtr -z --json google.com

Does not list AS in the output:

{
      "count": "16",
      "host": "iad23s63-in-f14.1e100.net",
      "Loss%": 0.00,
      "Snt": 10,
      "Last": 26.74,
      "Avg": 33.13,
      "Best": 23.82,
      "Wrst": 58.07,
      "StDev": 11.98
    }
thetechcatalyst commented 2 years ago

It actually looks to be the same situation for XML output as well.

robert-scheck commented 2 years ago

As of mtr 0.94 and 0.95, my tests do not confirm your findings for --json except when mtr was built using --without-ipinfo, the code is actually in ui/report.c:346-356.

However, for --xml, the situation is different: There is no such code when looking to ui/mtr.c:67-85 and ui/report.c:403-461.