Hi all, i am trying to parse in Logstash 6.2.2 this log:
--- BEGIN ----- 4.3.2018 13:29:26.286 ---
Identification: ABC_a1262e23-74a3-4f57-bd79-ee025805bee5 (c0cc8fa7-d8ad-4cda-8a27-c1af03794ca0)
Message: Get signed data object ended successfuly.
Identification: ABC_a1262e23-74a3-4f57-bd79-ee025805bee5 (c0cc8fa7-d8ad-4cda-8a27-c1af03794ca0)
--- END ----- 4.3.2018 13:29:26.286 (2,4811 ms) ---
--- BEGIN ----- 4.3.2018 13:29:26.302 ---
Identification: ABC_a1262e23-74a3-4f57-bd79-ee025805bee5 (c0cc8fa7-d8ad-4cda-8a27-c1af03794ca0)
Message: Get signed data object.
Identification: ABC_a1262e23-74a3-4f57-bd79-ee025805bee5 (c0cc8fa7-d8ad-4cda-8a27-c1af03794ca0)
--- END ----- 4.3.2018 13:29:26.302 (2,4565 ms) ---
--- BEGIN ----- 4.3.2018 13:29:26.302 ---
Identification: ABC_a1262e23-74a3-4f57-bd79-ee025805bee5 (c0cc8fa7-d8ad-4cda-8a27-c1af03794ca0)
Message: Get signed data object.
Identification: ABC_a1262e23-74a3-4f57-bd79-ee025805bee5 (c0cc8fa7-d8ad-4cda-8a27-c1af03794ca0)
--- END ----- 4.3.2018 13:29:26.302 (2,4565 ms) ---
--- BEGIN ----- 4.3.2018 13:28:09.330 ---
Identification: ABC_36db79f6-dc39-4df3-82f3-297d72316bb2 (c846e462-e755-4aae-87cf-89e556a355c2)
Message: Initialization started.
Message: Initializing config reader. 95,4582 ms
Message: Initializing error log. 0,0997 ms
Message: Initializing plugins: 6,1417 ms - 2 item(s) - msg from LoadPlugins:
LoadPlugins
Search files "XYZ.*.dll": 0,2736 ms - 2 file(s).
CurrentDomainAssemblies: 0,1078 ms - count 156.
Processing file: XYZ.Pdf.dll.
CheckToken for PdfPlugin: 0,0228 ms.
Processing file end: 1,6042 ms.
Processing file: XYZ.Png.dll.
CheckToken for PngPlugin: 0,0213 ms.
Processing file end: 1,2178 ms.
GetPlugins
Foreach gettypes: 0,0313 ms.
Foreach types: 0,2379 ms.
GetPlugins end: 0,2882 ms.
LoadPlugins end: 6,1281 ms.
Message: Create xml document: 5,6369 ms
Message: Create namespace manager: 0,0076 ms
Message: Check signature version: 0,0203 ms
Message: Verify signature schema 6,367 ms - removed node count: 0 item(s).
Message: validateSignaturePolicy: ASDSDFGDSFGSDFGDSFG
Message: Initialization ended successfuly.
Identification: ABC_36db79f6-dc39-4df3-82f3-297d72316bb2 (c846e462-e755-4aae-87cf-89e556a355c2)
--- END ----- 4.3.2018 13:28:09.642 (321,7862 ms) ---
In my conf i am at begining trying to parse start datetime - --- BEGIN ----- 4.3.2018 13:28:09.330 ---
My conf is:
input {
file {
path => ["file.log"]
start_position => "beginning"
sincedb_path => "/dev/null"
codec => multiline {
pattern => "^--- BEGIN"
negate => true
what => "previous"
auto_flush_interval => 30
}
}
}
filter {
grok {
match => [ "message", "(?<start>(?<=--- BEGIN ----- ).*(?= ---))" ]
}
}
output {
stdout { codec => rubydebug }
elasticsearch {
hosts => ["localhost:9200"]
action => "index"
index => "log_index"
}
stdout { }
}
Parsing multiline events working fine but parsing start is returning _grokparsefailure, even my grok is working in grokdebug https://grokdebug.herokuapp.com/. Interesting is that this grok is working fine
grok {
match => [ "message", "(?<start>(?<=--- BEGIN ----- ).{21})" ]
}
but my start string is not having fixed length.
Do you have any idea where is the problem?
Regards
Martin