美文网首页
[转]Fluentd配置使用

[转]Fluentd配置使用

作者: bobcorbett | 来源:发表于2017-08-15 11:20 被阅读0次

    如果你安装Fluentd运用的是rpm或是deb 的安装包,这个配置文件在/etc/td-agent/td-agent.conf 这个目录。重新安装将会安装conf 配置文件。

    $ sudo vi /etc/td-agent/td-agent.conf

    如果你安装Fluentd 用的是Ruby Gem,你可以创建一个配置文件运用下面的命令。发出一个终止信号将会重新安装配置文件。(如果你修改了配置文件—fluent.conf 文件,ctrl c c 终止进程,然后在配置文件下重新启动)

    $ ctrl c

    $fluentd -c fluent.conf

    $ sudo fluentd --setup /etc/fluent

    $ sudo vi /etc/fluent/fluent.conf

    这个配置文件由以下指令组成:

    1.source指令决定输入资源。

    2.match指令决定输出目的地。

    3.include指令包含其他一些文件

    Fluentd的输入源是通过选择和配置所需要的输入插件使用source指令。Fluentd的标准输入插件包含http和forward(转发)模式。

    # Receive events from 24224/tcp#从24224/tcp 中接收事件,tcp模式

    # This is used by log forwarding and the fluent-cat command#使用日志转发和fluent-cat 命令

    type forward

    port 24224

    #http://this.host:9880/myapp.access?json={"event":"data"}

    type http

    port 9880

    每个source指令必须包含一个type(类型)参数。type参数指定输入插件使用。

    相关文章

      网友评论

          本文标题:[转]Fluentd配置使用

          本文链接:https://www.haomeiwen.com/subject/cmpmrxtx.html