logstash -f xxxx.conf 로 실행을 하면 언제 업무를 끝마쳤는지 알기 쉽지 않다. 그럴경우 파일을 stdin 의 redirect 값으로 던져주면 수행을 마치면 자동적으로 내려가게 된다. 구조는 다음과 같다.

logstash -f xxx.conf < yyy.json

ㄱ] logstash conf 파일 

input {

    stdin {

        codec => "json"

    }   

}

 

output {

    stdout {

        codec => rubydebug

    }   

}

ㄴ] json 파일 

{"name": "kimjunhyeon"}

{"name": "LeeJung"

ㄷ] 실행

$ logstash -f basic_01.conf < test.json