mtr icon indicating copy to clipboard operation
mtr copied to clipboard

Feature request: Place hostname (reverse-dns) and address in different attributes in HUB element in XML output

Open emjemj opened this issue 9 years ago • 2 comments

It would be good to be able to access both host name and address of HUB by parsing the XML document and not having to do string parsing of the HOST field to get both values.

emjemj avatar Mar 12 '15 10:03 emjemj

so at the moment if you specify --show-ips, you'll get <hostname> (<ip_addr>), hostname followed by ip address in parens. Which is consistent in all the reporters ... but only if it actually resolved a name, otherwise you'd get only <ip_addr>, no hostname of course and ip address not in parens. Which I suppose is behaviourally consistent, but structurally not so much. So I can see why it might be nice to use explicit fields in these structured formats, xml, json etc.

Is there further demand for this feature request? opposition?

krisl avatar Apr 16 '21 21:04 krisl

I agree. Getting things apart is MUCH more difficult than putting things together. Consider addresses. When users enter a city, starte/province then it's easy to put them next to each other for printing as an address line. But the other way around is difficult. "Dallas texas" is easy to split but "new york new york"and "Salt lake city utah" are more difficult.

Anyway, valid concern that the IP address sometimes ends up differently (not in parentheses) , which hinders parsing. Jeah, just split them.

rewolff avatar Apr 17 '21 06:04 rewolff