filebeat踩坑

使用filebeat5.0.1版本,用filebeat作爲日誌收集工具時:

java日誌格式需要多行匹配,在filebeat配置文件中添加:


  ### Multiline options

  # Mutiline can be used for log messages spanning multiple lines. This is common

  # for Java Stack Traces or C-Line Continuation

  # The regexp Pattern that has to be matched. The example pattern matches all lines starting with [

  multiline.pattern: ^\[ 

  # Defines if the pattern set under pattern should be negated or not. Default is false.

  multiline.negate: true

  # Match can be set to "after" or "before". It is used to define if lines should be append to a pattern

  # that was (not) matched before or after or as long as a pattern is not matched based on negate.

  # Note: After is the equivalent to previous and before is the equivalent to to next in Logstash

  multiline.match: after


上面配置的意思是:不以[開頭的行都合併到上一行的末尾

pattern:正則表達式

negate:true 或 false;默認是false,匹配pattern的行合併到上一行;true,不匹配pattern的行合併到上一行

match:after 或 before,合併到上一行的末尾或開頭



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章