Coder Social home page Coder Social logo

Comments (2)

spujadas avatar spujadas commented on August 16, 2024 6

Hi and thanks for the kind words!

Here's what you need to do to use GELF logs with Logstash's GELF input plugin:

  • Create an input configuration file to enable Logstash's GELF input plugin. For instance, create a file named 03-gelf-input.conf and containing the following empty configuration, which uses all the defaults:

    input {
        gelf {}
    }
    
  • Overwrite the default 30-output.conf so that the index and document_type configuration options in the elasticsearch section don't make use of Beats-specific metadata.

  • Extend the base image by creating a Dockerfile with contents similar to:

    FROM sebp/elk
    
    ADD ./03-gelf-input.conf /etc/logstash/conf.d/03-gelf-input.conf
    # TODO: add ADD directive to overwrite 30-output.conf as needed
    
    # expose GELF's default UDP port (12201)
    EXPOSE 12201/udp
    
  • Build the extended image.

  • Start a container from the extended image as you would ordinarily do, with the additional option -p 12201:12201/udp in order for the container publish GELF's default UDP port (12201).

You can now start another container using the GELF log driver, and you'll see its logs in Elasticsearch and Kibana.

As an example:

docker run -it --log-driver=gelf --log-opt gelf-address=udp://localhost:12201 alpine sh

will push every line of shell input and output to ELK.

Hope that helps.

from elk-docker.

spujadas avatar spujadas commented on August 16, 2024

Housekeeping: closing this issue, please feel free to reopen if needed.

from elk-docker.

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.