ecs-dotnet icon indicating copy to clipboard operation
ecs-dotnet copied to clipboard

[Question] Parsing back log files create by ECS for Serilog.

Open LiorBanai opened this issue 3 years ago • 5 comments

Hi, I want to create a parser for exist log file for my https://github.com/Analogy-LogViewer/Analogy.LogViewer application.

Is there an example how to read back a file? All the units test seems to only write logs.

LiorBanai avatar Aug 24 '22 16:08 LiorBanai

Hi,

I guess you can just read the log file using File.ReadAllLines() and then parse every line using EcsDocument.Deserialize(). You'll need to reference Elastic.CommonSchema package for that.

andreycha avatar Aug 28 '22 11:08 andreycha

@andreycha Thanks, I'll try it.

LiorBanai avatar Aug 28 '22 11:08 LiorBanai

BTW, are the latest changes released as nuget? The last one is from 2021

LiorBanai avatar Aug 28 '22 13:08 LiorBanai

No. Looks like the plan is to upgrade the library right to 8.4.0, I believe you can follow it here: https://github.com/elastic/ecs-dotnet/issues/197

andreycha avatar Aug 28 '22 18:08 andreycha

@andreycha Thanks!

LiorBanai avatar Aug 28 '22 18:08 LiorBanai

Thanks for answering @andreycha :+1: Closing this out while we gear up to release #197

Mpdreamz avatar Sep 01 '22 15:09 Mpdreamz