question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Finding a better name for `url.hostname`, `source.hostname` and `destination.hostname`

See original GitHub issue

As most of you have realized, using the word “hostname” for two different purposes in ECS is bugging me. I’m very happy of the resistance I’ve faced when bringing this up so far, because it has forced me to dig deeper and figure this out more precisely. Hopefully this helps me make a better case for why in one of these two cases, “hostname” is incorrect.

Two usages of hostname in ECS

Let’s review the two different uses of “hostname” currently in ECS:

  • “hostname” as a server or device name, as given by administrators. Or the value you get when you run the command hostname on a host/device.
    • This use I agree 100% with.
    • Currently used this way in device.hostname and host.hostname.
    • To complicate the following discussion, some network devices default to returning their main IP address, when they don’t have a textual hostname configured.
  • “hostname” as a network address, which may be an IP or a domain name.
    • This is the use I object with, and what I want to address here. From most sources I’ve seen, this usage of “hostname” is incorrect, it should be “host”.
    • Currently used this way in source.hostname, destination.hostname and url.hostname
    • If some of us thought this was meant to be a place to populate with the hostname of a host under management (e.g. via enrichment):
      1. This confirms that this is an ambiguous name, because that’s not the actual purpose. The purpose is to store an address prior to having determined whether it’s an IP or a name.
      1. Enrichment with known host details – if someone wanted to do that – would be done more accurately by nesting a subset of the host fields in there instead anyway (e.g. host.id, host.hostname).

What’s wrong with hostname?

In the RFCs I’m aware of, when mentioning “a network address, which may be an IP or a domain name”, they all refer to that as a “host”, not a “hostname”. They sometimes use the word “hostname” (but not always) to refer to an address that’s a registered name (such as a domain name or a local DNS entry).

This is not a recent change either, the oldest RFC I’m linking to below is from 1994, and is using “host” to mean the “ip or name” concept. Here’s a few excerpts:

The fact that they are sometimes mentioned in the same places or even in some cases used interchangeably in tool documentation (we’re not the only ones facing this mixup) helps explain why the two are often mixed up. I haven’t looked farther back in the RFCs, so that mixup may indeed come from there.

However as @MikePaquette pointed out, using the name “host” in these places would conflict with our top level field set “host”. Even if “host” is not currently a reuseable object, I do think it could become one, and the most obvious places I would expect to nest it is at source.host and destination.host.

So I agree we should not rename these 3 fields to *.host.

Here are some suggestions for new field names, based on what I’ve seen in the various server documentation tools and the RFCs. Remember that these proposed renames apply only to source, destination and url, not to host and device:

  • host_address
  • uri_host or url_host
  • Drop hostname from source, destination and url.
    • In most cases people will want to store the value in their proper field (ip or domain), after determining which type it is. Them wanting to keep the ambiguous field anyway could be considered a use case, and they’re free to name this field however they want, if it’s not in ECS.
    • Independent from subpoint above, we could also work on finding the right name for this field after Beta1, and just drop the field out of ECS temporarily for the Beta1 release.

I’m open to other suggestions, of course.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
MikePaquettecommented, Nov 6, 2018

@webmat thanks, LGTM.

BTW, I will make a case for defining a related.domain when we get to discuss #67 which would be an array containing a copy of whatever we populate source.domain, destination.domain, and url.domain with.

0reactions
webmatcommented, Nov 6, 2018

@ruflin Would you be good for this version of the proposal for Beta1? https://github.com/elastic/ecs/issues/166#issuecomment-436349290

Read more comments on GitHub >

github_iconTop Results From Across the Web

URL.hostname - Web APIs - MDN Web Docs - Mozilla
The hostname property of the URL interface is a string containing the domain name of the URL.
Read more >
Domain vs Host Name vs FQDN Implementation - OSSEM
This guide will show you how to label FQDNs, Domains, and Hostnames (for both source/destination) commonly found in logs for Endpoint, DNS, HTTP,...
Read more >
Target Hostname or IP Address - Get IP from ... - Dotcom-Monitor
All you need to do is to navigate to one of the free online WHOIS services and enter the target domain name in...
Read more >
How to filter by host name in Wireshark? - Unix Stack Exchange
To make host name filter work enable DNS resolution in settings. To do so go to menu "View > Name Resolution" And enable...
Read more >
Difference between host name and domain name - Super User
hostname is the name given to the end-point (the machine in question). and will be used to identify it over DNS if that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found