Using Output file plugin + no output logs

976 views
Skip to first unread message

Piyush Agarwal

unread,
Jun 30, 2014, 1:25:33 PM6/30/14
to flu...@googlegroups.com
Hi All,

I am using following config file.


## live debugging agent

<match fluentd.**>

  type stdout

  log_level trace

</match>


<source>

  type forward

  port 24224

  bind 0.0.0.0

</source>


<source>

  type http

  port 8888

</source>


## File input

## read apache logs continuously and tags td.apache.access

<source>

  type tail

  path /var/log/hudson-bigQ/hudson-bigQ*.log

  pos_file /var/log/td-agent/hudson_bigQ.log.pos

  tag fluentd.*

  format none

  read_from_head true

  log_level trace

</source>



## File output

# match tag=local.** and write to file

<match fluentd.**>

  type file

  path /var/log/hudson-bigQ

  append true

  time_slice_format %Y%m%d

  time_slice_wait 10m

  time_format %Y%m%dT%H%M%S%z

  buffer_type file

  buffer_path /var/log/td-agent/buffer/buffer.log

  log_level trace

</match>



I can see logs in td-agent.log but there are no logs in the folder specified by me in output file config




Thanks

Kiyoto Tamura

unread,
Jun 30, 2014, 1:38:50 PM6/30/14
to flu...@googlegroups.com
Hi Piyush,


>I can see logs in td-agent.log but there are no logs in the folder specified by me in output file config

That is an expected behavior with your configuration: Fluentd scans the config file top to bottom, and once the event's tag is matched, run that match block against the event without going through the rest of the config. In your case, this means only

<match fluentd.**>
  type stdout
  log_level trace
</match>

is matched. If you want to match both, you should use the copy plugin and have both stdout and file inside it like this:

<match fluentd.**>
  type copy
  <store>
    type stdout
    log_level trace
  </store>
  <store>

    type file
    path /var/log/hudson-bigQ
    append true
    time_slice_format %Y%m%d
    time_slice_wait 10m
    time_format %Y%m%dT%H%M%S%z
    buffer_type file
    buffer_path /var/log/td-agent/buffer/buffer.log
    log_level trace
  </store>
</match>


Kiyoto


--
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.



--
Check out Fluentd, the open source data collector for high-volume data streams

Piyush Agarwal

unread,
Jun 30, 2014, 1:59:56 PM6/30/14
to flu...@googlegroups.com
Thanks kiyoto for your suggestion.

Now I am able to see logs in buffer.log , but still no output at the path specified   path /var/log/hudson-bigQ

Kiyoto Tamura

unread,
Jun 30, 2014, 2:01:43 PM6/30/14
to flu...@googlegroups.com
That's because it's still buffering. When the flush event occurs, you should see data into /var/log/hudson-bigQ

Masahiro Nakagawa

unread,
Jun 30, 2014, 2:04:03 PM6/30/14
to flu...@googlegroups.com
Check also this configuration document:


Reply all
Reply to author
Forward
0 new messages