Hello,
I tried to use rewrite_tag_filter at my server level. Here is my config :
<source>
@type forward
@log_level debug
port 24224
</source>
<match logback.security.**>
@type rewrite_tag_filter
@log_level debug
rewriterule1 publictest ^\(-test-\).*$ public.logback.security.${tag_parts[2]}.${tag_parts[3]}
rewriterule2 privateall ^\(!-test-\).*$ private.logback.security.${tag_parts[2]}.${tag_parts[3]}
</match>
<match {jbossserver.**,public.logback.security.**,private.logback.security.**}>
@type forest
@log_level debug
subtype file
<template>
time_slice_format %Y%m%d
time_slice_wait 1m
time_format %Y%m%dT%H%M%S%z
compress gzip
utc
format single_value
</template>
<case jbossserver.**>
path /var/public/log/${tag_parts[1]}/${tag_parts[2]}/jbossserver
</case>
<case public.logback.security.**>
path /var/public/log/${tag_parts[2]}/${tag_parts[3]}/security-logback
</case>
<case private.logback.security.**>
path /var/private/log/${tag_parts[2]}/${tag_parts[3]}/security-logback
</case>
</match>
The idea is :
- my client send a log tagged logback.security.tenant-test-001-foo.myhostname
- my server match the tag logback.security.**
- (if my rewrite rule work) the rewriterule rewrites logback.security.tenant-test-001-foo.myhostname to public.logback.security.tenant-test-001-foo.myhostname
- the new tag public.logback.security.** is matched by the other match bloc
- the forest plugin produces the log under /var/public/log/tenant-test-001-foo/myhostname/security-logback
but it doesn't work, probably something wrong with my config.
I only saw in /var/log/td-agent/td-agent.log :
2016-06-03 11:26:48 +0200 [info]: out_forest plants new output: file for tag 'jbossserver.tenant-test-001-foo.myhostname'
but nothing for public.logback.security or private.logback.security.
Do you have an idea of where my config is wrong ?