filebeat 7.4 codec. format 변수 설정 방법

2094 단어 filebeat
filebeat 7.4 codec.format 변수 설정 방법
어떤 버 전의 filebeat 를 사용 하 든 output. xx 에서 code. corat 변 수 를 설정 해 야 합 니 다. 처음에 홈 페이지 에서 조회 한 결과 더 편리 한 방법 이 있 습 니 다.
중요 한 것 은 codec. format 의 변 수 는 모두 json 을 생 성 한 대상 에서 얻 은 것 입 니 다. 즉, 정보 와 메타 데 이 터 는 모두 준비 output 목 표를 생 성 했 습 니 다.
  • 인쇄 outputjson 데이터
  • {
        "@timestamp":"2019-11-19T06:42:34.222Z",
        "@metadata":{
            "beat":"filebeat",
            "type":"_doc",
            "version":"7.4.2",
            "topic":"xxx-click"
        },
        "host":{
            "name":"eeexx-asdddd"
        },
        "agent":{
            "version":"7.4.2",
            "type":"filebeat",
            "ephemeral_id":"3969b5f3-9aa2-4c5a-b8bd-971017f480c5",
            "hostname":"eeexx-asdddd",
            "id":"10b92cfc-b641-4dde-a72f-a599e178e05d"
        },
        "log":{
            "offset":48845307,
            "file":{
                "path":"/Log-xxxx.log"
            }
        },
        "message":"2019-11-19 14:42:33.830 INFO  .0 (iPhone; CPU iPhone OS 13_1_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148" "" """,
        "input":{
            "type":"log"
        },
        "fields":{
            "log_topic":"xxx-click"
        },
        "ecs":{
            "version":"1.1.0"
        }
    }
  • 필요 한 설정 codec.format
  • output.kafka:
      codec.format: '%{[fields.log_topic]} %{[agent.hostname]}'
    output.kafka 출력 정보 이상
    브로커 172.16. xx. xx: 9092 kafka 메시지: 클 라 이언 트 / metadata 는 일부 파 티 션 이 leaderless' 이상 정보 임 을 발 견 했 습 니 다.
  • 이상 원인 kafka 에 생 성 되 지 않 았 습 니 다 xx-play topic 생 성 되면 정상적으로 출력 됩 니 다 topic
  • 이런 이상 정보 가 발생 했 을 때 여러 개 output 도 영향 을 미 쳐 정상 적 이지 못 하 다 out 정보
  • 좋은 웹페이지 즐겨찾기