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

Have date scrubber allow all possible datetime formats as an array #115

Open
jmasonlee opened this issue Aug 11, 2022 · 0 comments
Open

Comments

@jmasonlee
Copy link
Contributor

I have logs, but I don't have full control over the format of those logs.

Some of the dates in my logs look like this:
2022-08-11

Some of the dates in my logs look like this:
2022-08-11 14:03:49.911513

Some of the dates in my logs look like this:
2022-08-11 14:03:49

Only the last one is properly scrubbed by scrub_all_dates.

I like this for scrubbing a default date pattern:
options=Options().with_scrubber(scrub_all_dates)

I also want to be able to do something like this:
date_formats = ["%Y-%m-%d", "%Y-%m-%d %H:%M:%S:%f", "%Y-%m-%d %H:%M:%S" ]
options=Options().with_scrubber(scrub_all_dates(date_formats))

Here is the docs on datetime formatting in python:
https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes

I'm not sure when I will be able to join next, so I'm documenting this here in case you feel like doing it before then :-)

I can work around this for now

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

No branches or pull requests

1 participant