

ELK~fluentd和logback多行文本避免折断
source link: https://www.cnblogs.com/lori/p/14848442.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

fluentd的配置
<source>
type tail
path "/var/log/*.log"
pos_file "/var/log/*.log.pos"
tag "test"
refresh_interval 120
format multiline
format_firstline /\d{4}-\d{1,2}-\d{1,2}/
format1 /^(?<access_time>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}) (?<application>[^ ]*) \[(?<app_thread>.*)\] (?<level>[^ ]*) (?<message>.*)/
<parse>
format_firstline /\d{4}-\d{1,2}-\d{1,2}/
@type multiline
format1 /^(?<access_time>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}) (?<application>[^ ]*) \[(?<app_thread>.*)\] (?<level>[^ ]*) (?<message>.*)/
</parse>
</source>
<match **>
@id elasticsearch
@type elasticsearch
@log_level "debug"
index_name "fluentd"
host "elasticsearch.elk"
port 9200
include_tag_key true
tag_key "@log_name"
logstash_format true
flush_interval 10s
logstash_prefix "test"
<buffer>
flush_interval 10s
</buffer>
</match>
logback.xml配置
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<springProperty scope="context" name="appName" source="spring.application.name" />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} ${springAppName} [%thread] %-5level %logger{50} - %msg%n</pattern>
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="STDOUT" />
<appender-ref ref="FLUENT_TEXT" />
</root>
</configuration>
Recommend
-
92
Professionals | Community Groups Programs | Google Developers
-
106
来自用户的最佳实践分享,如何用阿里开源的Docker日志收集工具fluentd-pilot收集机器上所有Docker应用日志。fluentd-pilot简介fluentd-pilot是阿里开源的docker日志收集工具,
-
79
Home Blog
-
63
一、logstash Logstash: 是一个灵活的数据传输和处理系统,在beats出来之前,还负责进行数据收集。Logstash的任务,就是将各种各样的数据,经过配置转化规则,统一化存入Elasticsearch。使用Ruby开发的Logstash在灵活性上,非...
-
11
2021年05月19日 阅读 8742 CSS 实现多行文本“展开收起” 本文作者:严文彬 原...
-
9
拜托,css这样实现多行文本“展开收起” 超酷的好吧 2022年02月16日 07:33 · 阅读 3501
-
5
产品更新 使用富文本,让多行文本字段更具可读性 备受期待的「富文本」功能上线啦! ...
-
6
男孩在下棋中被机器人折断手指:因为想“先走一步” 2022年07月24日 19:05 9564 次阅读 稿源:
-
3
完美掌握多行文本修剪技巧:CSS中的实用指南 作者:dev 2023-07-28 10:21:46 这篇文章深入讨论了在CSS中裁剪多行文本的方法,以提高网页的外观和用户体验。作者首先介绍了常见的CSS文本裁剪技术,例如使用text-ove...
-
8
CSS 多行文本超链接下划线动效
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK