2016-10-27 9 views
0

grok 파서를 사용하여 데이터를 구문 분석하는 방법을 찾고 있습니다. 그러나 사용법에 어려움이 있습니다. 내 목적은 필터를 사용하여 grok patter를 사용하여 추가 필드를 추가하고 싶습니다.Fluentd에서 Grok 파서 사용하기

뭔가 같은이 Fluend 불평이나 물건을 많이 사용하지 않는 것을 경고 사용

<filter acme.**> 
    @type parser 
    key_name log 
    format grok 
    <parse> 
     <grok> 
      @type grok 
      grok_pattern grok_pattern %{TIMESTAMP_ISO8601:time_stamp}%{SPACE} 
     </grok> 
    </parse> 
</filter> 

..

  • 에 ... '@type이'사용하지 않는 매개 변수입니다. 섹션
  • 파라미터 'grok_pattern'에 ..는
  • 를 사용하지
필터를 사용 Fluentd에 grok 수있는 파서를 사용하는 방법에

아누 큐?

답변

1

Fluentd v0.12.29 filter parser plugin이 포함 된 다음 구성으로 작동합니다. <parse> 섹션은 v012.29와 함께 사용할 수 없습니다. v0.14부터 사용할 수 있지만 Fluentd v0.14.8에는 필터 구문 분석기 플러그인이 포함되어 있지 않습니다. https://github.com/fluent/fluentd/pull/1191

ttps : //github.com/tagomoris/fluent-plugin-parser는 Fluentd v0.14를 현재 지원하지 않습니다.

<source> 
    @type dummy 
    tag dummy.log 
    dummy [ 
    { "message": "Oct 24 09:01:33 mymachine uim-toolbar[5831]: Theme parsing error: <data>:2:30: The style property GtkWidget:focus-line-width is deprecated and shouldn't be used anymore. It will be removed in a future version" }, 
    { "message": "Oct 24 09:01:33 mymachine uim-toolbar[5831]: Theme parsing error: <data>:3:27: The style property GtkWidget:focus-padding is deprecated and shouldn't be used anymore. It will be removed in a future version" }, 
    { "message": "Oct 24 09:01:33 mymachine uim-toolbar[5831]: Theme parsing error: <data>:2:30: The style property GtkWidget:focus-line-width is deprecated and shouldn't be used anymore. It will be removed in a future version" } 
    ] 
</source> 

<filter **> 
    @type parser 
    key_name message 
    format grok 
    grok_pattern %{SYSLOGTIMESTAMP:timestamp} %{SYSLOGHOST:host} %{SYSLOGPROG}: %{GREEDYDATA:message} 
</filter> 

<match **> 
    @type stdout 
</match> 

https://github.com/fluent/fluent-plugin-grok-parser/issues/23

보기