Why logs appear to be parsed correctly by Fluent-Bit but don’t show up in Opensearch-Dashboards?

Stack

Opensearch + Opensearch-Dashboards + Fluent-Bit

Goal

Parse Apache Tomcat’s catalina.out log file

Configs

fluent-bit.conf:

[SERVICE]
    Flush                 5
    Log_Level             info
    Parsers_File          parsers.conf


[INPUT]
    Name   tail
    Tag   tomcat.access
    Path    /u01/tomcat/apache-tomcat/logs/access*.txt
    Parser   tomcat_access

[INPUT]
    Name tail
    Tag tomcat.catalina
    Path /u01/tomcat/apache-tomcat/logs/catalina.out

[FILTER]
    Name multiline
    Match tomcat.catalina
    multiline.key_content log
    multiline.parser tomcat_catalina_multiline, java

[FILTER]
    Name     parser
    Match    tomcat.catalina
    Key_Name log
    Parser   tomcat_catalina_spring
    Preserve_key On

[OUTPUT]
    Name file
    Match tomcat.catalina
    Path /u01/fluent-bit
    Format out_file

[OUTPUT]
    Name                  opensearch
    Match                 tomcat*
    Host                  <host>
    Port                  <port>
    Suppress_Type_Name    On
    Index                 tomcat-test

parsers.conf:

[PARSER]
    Name        tomcat_access
    Format      regex
    Regex       ^(?<host>S+) (?<ident>S+) (?<user>S+) [(?<time>.*)] "(?<method>S+) (?<url>S+) (?<protocol>S+)" (?<status>S+) (?<size>S+)$
    Time_Key    time
    Time_Format %d/%b/%Y:%H:%M:%S %z

[PARSER]
    Name        tomcat_catalina_spring
    Format      regex
    Regex       ^(?<time>d+-d+-d+ d+:d+:d+.d+)s+(?<level>S+) d+ --- [s*(?<thread>[^]]+)] (?<context>S+)s+: (?<message>.*)$
    Time_Key    time
    Time_Format %Y-%m-%d %H:%M:%S.%L

[MULTILINE_PARSER]
    name          tomcat_catalina_multiline
    type          regex
    flush_timeout 500
    #
    # rules |   state name    | regex pattern                             | next state
    # ------|-----------------|--------------------------------------------------------
    rule      "start_state"      "/^(d+-d+-d+ d+:d+:d+.d+)(.*)$/"  "empty_row"
    rule      "empty_row"        "/^$/"                                    "error_row"
    rule      "error_row"        "/^.*$/"                                  "stacktrace"
    rule      "stacktrace"       "/^(s*at .*|)$/"                         "stacktrace"

File OUTPUT section

I’ve configured an output to a file for debugging purposes.
The tomcat.catalina contents seem to be just fine:

tomcat.catalina: [1723676238.680000000, {"level":"ERROR","thread":"main","context":"com.zaxxer.hikari.pool.HikariPool","message":"HikariPool-1 - Exception during pool initialization."}]
tomcat.catalina: [1723665438.703756094, {"log":"java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connectionntat ]
... <enormous multiline log entry here ...>"]
tomcat.catalina: [1723665438.703751094, {"log":"n"}]
tomcat.catalina: [1723676238.682000000, {"level":"WARN","thread":"main","context":"ConfigServletWebServerApplicationContext","message":"Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException... <long message here>"}]
### ... ###
### some seem to be parsed exactly how I need entries, same as following... ###
tomcat.catalina: [1723665438.703843277, {"log":"n"}]
tomcat.catalina: [1723676238.694000000, {"level":"INFO","thread":"main","context":"ConditionEvaluationReportLoggingListener"}]
tomcat.catalina: [1723665438.703843277, {"log":"n"}]
tomcat.catalina: [1723676238.723000000, {"level":"ERROR","thread":"main","context":"o.s.boot.SpringApplication","message":"Application run failed"}]
### and so on... ###

The problem

When I go to my Opensearch-Dashboards Discover tab, the parsed single line entries (those with level, thread, context and message fields) are not there. Only multiline ones and these:

tomcat.catalina: [1723665438.703843277, {"log":"n"}]

(The least show up as empty log ofc, the n symbol emerges only in JSON view.)

The fields are present at tomcat-test index Mappings and also show up in Fields of tomcat-test index pattern.

I’ve refreshed the tomcat-test index pattern fields, deleted the tomcat-test index, restarted both Fluent-Bit and Tomcat to recreate the index and push some new entries there. No errors reported by either Opensearch-Dashboards or Fluent-Bit.

New contributor

manururu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật