input { lumberjack { port => 8999 ssl_certificate => "/logstash-forwarder.crt" # ssl 인증 파일 ( logstash-forwarder 에도 동일한 파일로 ) ssl_key => "/logstash-forwarder.key" # ssl 인증 파일 ( logstash-forwarder 에도 동일한 파일로 ) } } filter{ if [type] == "log" { # 로그 패턴 정의, TIMESTAMP_ISO8601 변수는 logstash 자체 변수임, GREEDYDATA 변수는 아무렇게나 적절히 파싱.. 생각보다 잘됨 grok { match => [ "message", "%{TIMESTAMP_ISO8601:TIME}\t\[%{WORD:LEVEL}\]\t%{GREEDYDATA:LOG}\t%{GREEDYDATA:FILE}" ] } date{ match => ["TIME", "YYYY-MM-dd HH:mm:ss.SSS" ] target => "@timestamp" timezone => "Asia/Seoul" } mutate { remove_field => [ "TIME" ] } if "_grokparsefailure" in [tags] { drop {} } } if [type] == "pool-info"{ grok { match => [ "message", "%{TIMESTAMP_ISO8601:TIME}\t\[%{WORD:POOL_NAME}\]\s+%{NUMBER:USE}" ] } mutate { convert => { "USE" => "integer" } } date{ match => ["TIME", "YYYY-MM-dd HH:mm:ss.SSS" ] target => "@timestamp" timezone => "Asia/Seoul" } mutate { remove_field => [ "TIME" ] } if "_grokparsefailure" in [tags] { drop {} } } if [type] == "stat-info"{ grok { match => [ "message", "\[(?
'IT > elasticsearch' 카테고리의 다른 글
relocate index and log path problem (0) | 2017.12.05 |
---|---|
텔레그램 봇 만들기 (0) | 2016.03.28 |
logstash-forwarder 설정 (0) | 2015.10.31 |
인덱스 생성 (0) | 2015.10.10 |