2016-10-12 3 views
1

Fluentd를 처음 사용했습니다. <match> 태그 및 그 형식과 관련된 한 가지 문제점이 있습니다. 동일한 태그에 포맷 1format2 : 예를 들어Fluentd : 하나의 일치 항목에 여러 형식이 있습니다.

  • 우리의 시스템은 2 개의 다른 형식 반환 태그를
  • 우리가 제공하는 태그를 잡을 수 있지만 우리가없는 fluent.conf 사용 이 두 형식을 구분하는 방법

나는를 시도했지만 접두사를 추가 할 수 없습니다.

<match tag> 
    @type parser 
    format multi 

    <pattern> 
     format format1 
     add_prefix pattern1 
     ... 
    </pattern> 

    <pattern> 
     format format2 
     add_prefix pattern2 
     ... 
    </pattern> 
</match> 

이에 대한 해결 방법이 있습니까?

답변

1

나는 this Google Groups conversation에서 답 해결책이 있다고 생각 : 특히

을 (링크가 작동하지 않고 관심이 적은 사람들을 위해 시간을 절약 할 넣다) :

당신의 목적을 위해

, 당신은 copy 플러그인을 사용할 수 있습니다 .

<match tag> 
    type copy 
    <store> 
    type grep 
    input_key format_type 
    regexp pattern1 
    add_tag_prefix pattern1 
    </store> 
    <store> 
    type grep 
    input_key format_type 
    regexp pattern2 
    add_tag_prefix pattern2 
    </store> 
</match> 
<match pattern1.tag> 
</match> 
<match pattern2.tag> 
</match> 

input_key 요구에 대해 정규 표현식을 실행하는 열쇠가 될하려면 다음과 같이 필터링 후 전체 메시지를 복사합니다.

관련 문제