Logstash—Output模块-file

向文件中进行输出,默认以json格式向文件中输出信息,每行是一个事件event,并可进行编解码插件codec对某种数据格式进行转换

output {
    file {
        path:输出路径
        codec:编解码
        ceate_if_deleted:产生一个文件(即使文件可能被删除)
        dir_mode:使用目录的模式
        file_mode:使用文件的模式
        filename_failure:如果路径不正确,则输出信息会写此文件
        flush_interval:写入文件的设定时间间隔
        gzip:写入之前进行,对相关信息以zip格式输出
        workers:线程数量
    }
}
##########################################
output {
    file {
        ceate_if_deleted=>true
        file_mode=>777
        filename_failure=>"failedpath_file"
        flush_interval=>0
        path=>"/user/share/logstash/file.txt"
    }
}
posted @ 2022-04-02 09:53  wuyuan2011woaini  阅读(619)  评论(0编辑  收藏  举报