Multiple formats in one match

89 views
Skip to first unread message

Tuan Nguyen

unread,
Oct 12, 2016, 1:11:32 AM10/12/16
to Fluentd Google Group
Hi everyone,

I'm new at Fluentd. I have one problem regarding the <match> tag and its format. For example

- Our system returns 2 different formats: format1, and format2 at the same tag: tag
- Using fluent.conf we are able to catch the provided tag but we are unable to separate those two formats

I was expecting something similar to like this:

<match tag>
@type parser
format multi

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

Is there any work-around solution for this?

Mr. Fiber

unread,
Oct 13, 2016, 2:27:43 AM10/13/16
to Fluentd Google Group
Using rewrite-tag-filter before parser is one way.


Of course, redesign log generation side is important for resolving potential issue.


Masahiro

--
You received this message because you are subscribed to the Google Groups "Fluentd Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluentd+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

imekaku

unread,
Oct 18, 2016, 3:34:50 AM10/18/16
to Fluentd Google Group
Hi, Tuan, using `grep` and `copy` may be helpful.
I using regexp instead of format.

<match tag>
  type copy
  <store>
    type grep
    regexp1 log 200
    add_tag_prefix pattern1
  </store>
  <store>
    type grep
    exclude log 200
    add_tag_prefix pattern2
  </store>  
</match>
 
<match pattern1.tag>
...
</match>

<match pattern2.tag>
...
</match>



在 2016年10月12日星期三 UTC+8下午1:11:32,Tuan Nguyen写道:
Reply all
Reply to author
Forward
0 new messages