mtr icon indicating copy to clipboard operation
mtr copied to clipboard

AS Lookup for JSON output

Open thetechcatalyst opened this issue 4 years ago • 2 comments

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 avatar Jan 10 '22 03:01 thetechcatalyst

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

thetechcatalyst avatar Jan 10 '22 03:01 thetechcatalyst

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.

robert-scheck avatar Jan 12 '22 01:01 robert-scheck