tag parameter is required

1,603 views
Skip to first unread message

Aaron Todd

unread,
May 18, 2015, 1:37:51 PM5/18/15
to flu...@googlegroups.com
Hello all!

Just starting out with fluentd and am attempting to configure for inbound tcp using the tcp input plugin.  When I add the config t throws an error about the 'tag' parameter being required.  Unfortunately I do not see anything about the tag parameter in the documentation.  Anyone have any ideas about this message?  The config is below:

<source>
  type tcp
  port 514
<source>

And the error:

# /etc/init.d/td-agent start
Starting td-agent: 2015-05-18 13:13:41 -0400 [error]: fluent/supervisor.rb:273:rescue in main_process: config error file="/etc/td-agent/td-agent.conf" error="'tag' parameter is required"

Mr. Fiber

unread,
May 18, 2015, 4:31:29 PM5/18/15
to flu...@googlegroups.com
Hi Aaron,

Sorry, this is the mistake of fluentd document.
in_tcp article didn't mention tag parameter.
I just updated the document.



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+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aaron Todd

unread,
May 18, 2015, 8:33:36 PM5/18/15
to flu...@googlegroups.com
Masahiro,

Thanks!  Do  you have a quick link to the different types of "tags"?  I've been poking around the docs, but haven't found anything that describes the different strings and their meaning.

Thanks again!

Aaron

Mr. Fiber

unread,
May 19, 2015, 2:01:48 AM5/19/15
to flu...@googlegroups.com
For tag and routing,
http://docs.fluentd.org/articles/config-file article describes how to use tag with input plugins.


Masahiro


--

Aaron Todd

unread,
May 20, 2015, 1:12:12 PM5/20/15
to flu...@googlegroups.com
Masahiro,

Thanks for the link.  I believe I skimed over that, but since you linked me back to that page i've given it a good read.  I still dont quite understand though... 

I understand how the following config:
<match debug.**>
  type stdout
</match>
<source>
  type debug_agent
  bind 127.0.0.1
  port 24230
</source>

would match the command:  curl -X POST -d 'json={"json":"message"}' http://localhost:8888/debug.test

But if I add the following to the config:
<match at.test>
  type file
  path /var/log/td-agent/test
</match>

and change my command to curl -X POST -d 'json={"json":"message"}' http://localhost:8888/at.test nothing happens.  Any idea what am I missing?

Thanks again!

Aaron Todd

unread,
May 20, 2015, 1:59:18 PM5/20/15
to flu...@googlegroups.com
Masahiro,

As usual, the more I tinker the more I figure it out.  I think its starting to make sense.  I think the problem with my previous post is a separate issue with the  out_file plugin.  I changed it to the out_stdout plugin and now it matches and writes to the main log file.  So I'm not sure why it didn't write to the test file I specified, but its not a huge concern as it was only a test.  

So correct me if I'm wrong, but the "tag" parameter inside the in_tcp plugin seems to be only used for internal routing.  I can send anything at it on the listening port and it seems to match because of the "tag" parameter inside the tcp_plugin config.  Is that a safe assumption?

Thanks!

Aaron

Mr. Fiber

unread,
May 20, 2015, 11:12:52 PM5/20/15
to flu...@googlegroups.com
I think the problem with my previous post is a separate issue with the  out_file plugin.

file output plugin is buffered output and it takes a time to flush.

 Is that a safe assumption?

Yes. in_tcp receives logs and parses it. Parsed events are send to output plugin with 'tag' value.



--

Lance N.

unread,
May 23, 2015, 7:09:29 PM5/23/15
to flu...@googlegroups.com
There are 3 kinds of data passed between plugins: keys, values, and tag wildcards. Different plugins let you add, delete keys and change key values. Wildcards on tags give you a third "channel" to pass data. The channel is at the record level instead of the field level, and is narrow. 

As an example, the in_file plugin adds the full path of the file to the tag if you use a wildcard:

<source>
  type tail
  format json
  path /var/log/bugs/*.log
  pos_file /var/log/td-agent/bugs.pos
  tag bugs_infile.*
</source>

<match bugs_infile.*>
        filename ${tag_parts[4]}.log
</match>

If this fetches a new line from /var/log/bugs/alpha.log, the second tag will match "bugs_infile.var.log.bugs.alpha.log" and will add a field "filename":"alpha.log" because tag_parts[4] (counting from 0) is "alpha".

I have used tag wildcards to do complex matrix-based dispatching.
Reply all
Reply to author
Forward
0 new messages