Open AndisGrossteins opened 5 years ago
You could create a custom columnizer which parses unix timestamps and even sort them in columns, like TimeStampColumnizer. Currently there is no better approach to achive this
I'll try a stab at writing a custom columnizer with timestamp conversion next weekend. Although, it would be much better to create a line processor interface for similar tasks.
create a custom columnizer
I think there should be a differentiation between
columnizer
or tokenizer
: splits a line into several columns
(\d+)(.*)
column parser
or cell parser
: parses the content of a column to display it in a certain way
For naming, one could define a columnizer
as combination of one tokenizer
and multiple column parsers
.
The UI should then provide a way to assign column parsers
to the columns of a tokenizer
(e.g. by column index)
Use case
Some applications use Unix timestamps in log files. One such project is DNSCrypt/dnscrypt-proxy
For example, a few lines from dnscrypt-proxy query.log:
A few questions
Would it be possible to display Unix timestamps using a custom format (
%Y-%m-%d %H:%i:%s
)? Maybe as a custom columnizer? Or is there a better approach to implement something like this?