Skip to content
New issue

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

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

Already on GitHub? # to your account

Option to ignore lines that don't have valid timestamp? #42

Closed
RTnhN opened this issue Sep 26, 2024 · 4 comments
Closed

Option to ignore lines that don't have valid timestamp? #42

RTnhN opened this issue Sep 26, 2024 · 4 comments

Comments

@RTnhN
Copy link
Contributor

RTnhN commented Sep 26, 2024

I am working with some logs that have some other content sprinkled in. I would be fine with removing it though as long as it could still merge based on the lines that do have the right log format. So basically, it would be great to have an option that just ignored all invalid lines.

@ptmcg
Copy link
Owner

ptmcg commented Sep 27, 2024

The non-timestamped content shouldn't break the merging of the logs, it just appends the non-timestamped content as part of the most recent timestamped line.

But I have a working update that drops non-timestamped logs altogether - the switch is "--ignore_non_timestamped". You'll be able to see it in the demo mode using "logmerger --demo --ignore_non_timestamped"

@ptmcg
Copy link
Owner

ptmcg commented Sep 27, 2024

Before:
keep_non_timestamped_merged_logs

After:
ignore_non_timestamped_merged_logs

The double log messages at 08:00:11 are there because there were two separate log messages in the same log with the same timestamp. SInce both messages were timestamped, they were both kept.

@RTnhN
Copy link
Contributor Author

RTnhN commented Sep 27, 2024

Ah, cool! I'll have to try it.

@RTnhN RTnhN closed this as completed Sep 27, 2024
@ptmcg
Copy link
Owner

ptmcg commented Sep 27, 2024

I haven't pushed a release with this yet, but you can pull it from the master branch in the repo.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants