Giter VIP home page Giter VIP logo

Comments (6)

mp911de avatar mp911de commented on August 22, 2024

Hi Demetri,
this is an logback/network issue. Logback tries to resolve the local host name (forward/reverse) (see ch.qos.logback.core.util.ContextUtil/ContextUtil.java:35):

public static String getLocalHostName()

This runs in my case into an UnknownHostException which causes log back to fall back to the ip address. I've committed also some test cases into the repo to find out what's going on.

from logstash-gelf.

dmourati avatar dmourati commented on August 22, 2024

So, is the logback bug currently open or fixed? I see this: http://jira.qos.ch/browse/LOGBACK-749 Looks like you rev'd logback version dependency?

from logstash-gelf.

mp911de avatar mp911de commented on August 22, 2024

Yes, I've updated to 1.0.13. The logback bug is fixed. The bugfix causes logback not to crash any more but leads to supply the ip address (IPv4 or IPv6) when using HOSTNAME. You should get the right data a production environment where you have a DNS set up with correct setup hosts. (forward/reverse lookup entries).

from logstash-gelf.

dmourati avatar dmourati commented on August 22, 2024

Ahh, I understand your previous comment now, thanks. Is there an open issue against logback for this behavior? Seems to me requiring reverse DNS is not okay. We're behind a NAT here so all local workstations may show up as one "host". As I showed in my example, I can get the "correct" (preferred) hostname via the hostname command in logback.groovy. I double checked logback version on my end and it is also 1.0.13.

from logstash-gelf.

dmourati avatar dmourati commented on August 22, 2024

I was able to workaround my issue with the above additionalFields entry as well as adding to logstash the following:

filter {
if [type] == "gelf" {
mutate {
# Renames the 'originHost' field to 'host'
rename => [ "originHost", "host" ]
}
}
}

from logstash-gelf.

mp911de avatar mp911de commented on August 22, 2024

There is one more thing: logstash-gelf comes with an utility class RuntimeContainer, there you can find some constants which contain the hostname, FQDN and IP address. Check it out.

from logstash-gelf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.