If a user logs onto the server's physical console directly rather than logging on through a remote or graphical pseudo-terminal, then the lastlog output will not display the host field. To demonstrate this, I have logged on to my CentOS host directly to the tty1 console and avoided the GUI. The output from the previous AWK control file shows that we now have the users tux and bob; bob though lacks the host field as he is connected to a console:
Although in itself it's not an issue, it will be if we want to filter the fields and the two row's field numbers will vary where a field is omitted from some lines. For lastlog, we will have 9 fields for most connections and only 8 fields for those that connect directly to the server console. The goal for the application is that we print the username and the date, but not the time...