Giter VIP home page Giter VIP logo

elk-demo's Introduction

elk-demo

elk 환경에서 batch 로 실행한 데이터가 logstash로 전송되고 이를 elastic 에 저장 - kibana로 확인하는 기본적인 구성.
docker-elk 로 구성한 elk 클러스터 (단일모드) 를 활용한다.

image

본 프로젝트에서는 spring batch로 로그를 발생시킨 뒤 이를 추가한 플러그인을 통해 logstash로 보내도록 한다.

gradle에 추가

    implementation 'net.logstash.logback:logstash-logback-encoder:6.3'

logback.xml 일부

logstash에 tcp 방식으로 전송한다.

    <!-- 추'net.logstash.logback:logstash-logback-encoder:6.3' 를 통해 logstash로 전송 -->
    <appender name="stash" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
        <destination>127.0.0.1:5000</destination>

        <!-- encoder is required -->
        <encoder class="net.logstash.logback.encoder.LogstashEncoder" />
    </appender>

application.yml

logging.config: classpath:logback.xml



docker-elk logstash의 config 파일을 다음과 같이 수정해준다.

input {

        tcp {
                port => 5000
                codec => json_lines
        }
}

output {
        elasticsearch {
            hosts => "elasticsearch:9200"
            index => "logstash-20230430"
            user => "elastic"
            password => "changeme"
         }
} 

elk-demo's People

Contributors

yurim022 avatar leeeeeeena avatar

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.