Git Product home page Git Product logo

idaas-logstash-agent's Introduction

Overview

This repo is a simple bit of pre-canned config and extension of the official Logstash container. The intent is to use Logstash in a container as a client deployment option (vs installing it natively), with the following focuses:

  1. Give a pre-defined syslog input, exposed on UDP 5514 of the host
  2. Give a couple of examples of how to use custom config via a Dockerfile or via docker-compose

Usage options

There are a two primary usage options for this repo:

  1. Logstash client deployment via Docker Hub-hosted image
  2. Logstash client deployment via custom Docker image, with your baked-in configuration

Option 1: Logstash client deployment via Docker Hub-hosted image

There is a pre-built Docker image - based on the Dockerfile in this repo - hosted as ccfoss/logstash-syslog-proxy. The container needs to be able to resolve the host "elasticsearch," which you can do by using the add-host option in your docker run command.

For example, if your Elasticsearch endpoint's IP address was 10.2.3.4, you would run the container like so: docker run --name logstash_agent --add-host=elasticsearch:10.2.3.4 -p 5514:5514/udp ccfoss/logstash-syslog-proxy.

Logstash will run with the following config:

  1. Listens on UDP 5514 for syslog messages (pro-tip: you can test via netcat (nc) like so: nc -w0 -u 127.0.0.1 5514 <<< "pickles")
  2. Ships any logging to the ElasticSearch instance

Option 2: Use Dockerfile to build a new Docker image

If you want to have the same Logstash config on all clients, you might find it simpler to just create new Docker images with the required configuration baked right in. This means you do not have to ship the configuration around with the Dockerfile. It also means you can update the configuration by:

  1. Updating the Logstash configuration in ./config/logstash/conf.d
  2. Using docker build to update the image, followed by docker push to push the images
  3. Stop, remove, and re-deploy the container using the latest image

This can change your Logstash upgrades and/or config changes to a single-line command: docker stop logstash_agent; docker rm logstash_agent; docker pull myrepo/my-logstash-client:latest; docker run --name logstash_agent <your_repo/image_name>

The build/push process goes like this:

  1. Make any changes you wish to the configuration in ./config/logstash/conf.d directory.
  2. Once done with config changes, run docker build -t <your_repo/image_name> .
  3. Optionally, test your image by running it docker run -it --rm <your_repo/image_name>
  4. Once satisfied, upload your image by running docker push <your_repo/image_name>.

From there, you can run the docker stop/rm/pull/run one-liner listed above.

idaas-logstash-agent's People

Watchers

 avatar

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.