Logstash 설정

conquernos·2022년 5월 24일
0

logstash

목록 보기
1/1

logstash appender - timezone Asia/Seoul

        <appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
            <destination></destination>
            <encoder class="net.logstash.logback.encoder.LogstashEncoder">
                <customFields>{"foo":"bar"}</customFields>
                <timeZone>Asia/Seoul</timeZone>
                <timestampPattern>yyyy-MM-dd'T'HH:mm:ss.SSS</timestampPattern>
                <fieldNames>
                    <timestamp>timestamp</timestamp>
                    <stackTrace>exception</stackTrace>
                </fieldNames>
            </encoder>
        </appender>

filter date 설정

filter {
  date {
    match => ["timestamp" , "yyyy-MM-dd'T'HH:mm:ss.SSS"]
    target => "@timestamp"
  }
  mutate {
    remove_field => [ "timestamp" ]
  }
}
profile
search engineer

0개의 댓글