Skip to content

multiline_regex_before won't work when logfile ends with empty line #403

@jeroenmaelbrancke

Description

@jeroenmaelbrancke

Hello,

I still got some troubles when i'm using the multiline_regex_before with empty_lines...
I found out that if the last entry in your logfile is empty he will print all lines separately.

my logfile:
2016/04/25 06:48:18 919733 +0200 - cmp05 - 6747/0 - alba/proxy - 57397 - info - ETCD: etcdctl --peers=127.0.0.1:2379 set ovs/vpools/26ecee0c-a3ea-4d37-a245-3b0c0e18823b/proxies/890c3734-a8d6-47ec-ab59-b1d489c0b83c/config/abm [global]; cluster_id = ; cluster = ElLfeK1QfHheHtGO, ABSjdH4ybJRukOwD, wFWnl7M9oFjZMUKj; ; [wFWnl7M9oFjZMUKj]; client_port = ; ip = ; ; [ABSjdH4ybJRukOwD]; client_port = ; ip = ; ; [ElLfeK1QfHheHtGO]; client_port = ; ip = ;
[global]
cluster_id =
cluster = ElLfeK1QfHheHtGO, ABSjdH4ybJRukOwD, wFWnl7M9oFjZMUKj

[wFWnl7M9oFjZMUKj]
client_port =
ip =

[ABSjdH4ybJRukOwD]
client_port =
ip =

[ElLfeK1QfHheHtGO]
client_port =
ip =

2016/04/25 06:48:31 555754 +0200 - cmp05 - 6747/0 - alba/proxy - 57398 - info - update_osds

my beaver config
[/var/log/upstart/.log]
multiline_regex_before = ^[^\d{4}/\d{2}/\d{1,2}].

ignore_empty: 1
type: other
tags: other

You could easily fix this if you add
for line in lines:
if line == '':
break
....

in your multiline_merge function [https://github.com/python-beaver/python-beaver/blob/master/beaver/utils.py#L199]

Can you please fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions