Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

precise support for datetime format from docker text field style time="2022-10-09T21:33:15.541012931Z" #286

Open
jtmoon79 opened this issue Apr 20, 2024 · 0 comments
Labels
datetime format support for parsing some datetime pattern format good first issue Good for newcomers P2 less important

Comments

@jtmoon79
Copy link
Owner

jtmoon79 commented Apr 20, 2024

Add precise support this ad-hoc format found in docker logs, i.e. a more precise Regex.

Taken from these Rancher OS docker logs, like file dockerlaunch.log

time="2022-10-09T21:33:15.541012931Z" level=info msg="Starting up"
time="2022-10-09T21:33:15.547531433Z" level=info msg="libcontainerd: started new containerd process" pid=1178

This is very similar to the JSONL format "datetime": "2022-10-09T21:33:15.541012931Z" support implemented in 75d48b0.

To be clear, this format is already supported and will be parsed (hence Issue Label P2). However, 131 of the regular expressions are compiled to find this, as shown in this --summary output

$ s4 --summary ./logs/RancherOS-1.5.8/dockerlaunch.log
time="2022-10-09T21:33:15.541012931Z" level=info msg="Starting up"
...

File: ./logs/RancherOS-1.5.8/dockerlaunch.log
...
Program Summary:
...
Regex patterns        : 153
Regex compiled        : 131

The regular expression pattern used is generic. Prefer a more precise pattern for the popular Docker service.

@jtmoon79 jtmoon79 added P2 less important datetime format support for parsing some datetime pattern format labels Apr 20, 2024
@jtmoon79 jtmoon79 changed the title support for datetime format from docker text field style time="2022-10-09T21:33:15.541012931Z" precise support for datetime format from docker text field style time="2022-10-09T21:33:15.541012931Z" Apr 20, 2024
@jtmoon79 jtmoon79 added the good first issue Good for newcomers label Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datetime format support for parsing some datetime pattern format good first issue Good for newcomers P2 less important
Projects
None yet
Development

No branches or pull requests

1 participant