Update graylog.js

Fixed name resolution logic