Pattern for Parsing "2021-12-02T07:13:24.5072497Z"


Author
Message
klacol
klacol
New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)
Group: Forum Members
Posts: 3, Visits: 4
Hi all, I am using LogViewPlus, and it is working very well.

Now I came over a log file, that has Json entries and the date and time is provided like this:
2021-12-02T07:13:24.5072497Z

I tried to use this pattern,
%d{yyyy-MM-ddTHH:mm:ss.fffffffzzz}

but it says "Timestamp not found for log entry".

Does anybody know, how which pattern would work?
klacol
klacol
New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)
Group: Forum Members
Posts: 3, Visits: 4
I is simpler, this works:

%d{}

LogViewPlus Support
LogViewPlus Support
Respected User (1.8K reputation)Respected User (1.8K reputation)Respected User (1.8K reputation)Respected User (1.8K reputation)Respected User (1.8K reputation)Respected User (1.8K reputation)Respected User (1.8K reputation)Respected User (1.8K reputation)Respected User (1.8K reputation)
Group: Moderators
Posts: 1.1K, Visits: 3.6K
Hi Klacol,

'Z' in a timestamp is used to indicate Zero time - or UTC-0. It is not a standard timezone and cannot be understood with the standard timezone patterns. It is actually considered a literal rather than a timezone (similar to 'T').

The correct way to parse this is with a Z:
%d{yyyy-MM-ddTHH:mm:ss.fffffffZ}


%d on it's own will also work, but this is not recommended.  %d tells LogViewPlus to 'just figure it out'.  LogViewPlus is pretty good at figuring dates out, but this approach is a little slower.  Also, it is always better to parse more accurately where possible.

Hope that helps,

Toby
Edited 3 Years Ago by LogViewPlus Support
klacol
klacol
New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)
Group: Forum Members
Posts: 3, Visits: 4
Thanks Toby, thats works; have changed it in the settings.
LogViewPlus Support
LogViewPlus Support
Respected User (1.8K reputation)Respected User (1.8K reputation)Respected User (1.8K reputation)Respected User (1.8K reputation)Respected User (1.8K reputation)Respected User (1.8K reputation)Respected User (1.8K reputation)Respected User (1.8K reputation)Respected User (1.8K reputation)
Group: Moderators
Posts: 1.1K, Visits: 3.6K
Glad that helped - thanks for letting me know.

Toby
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Login

Explore
Messages
Mentions
Search