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

Different mlogfilter timezone behavior between stdin and file given on CLI #900

Open
nahoj opened this issue Dec 8, 2022 · 0 comments
Open
Labels

Comments

@nahoj
Copy link

nahoj commented Dec 8, 2022

mlogfilter seems to interpret --from 2022-11-22T00:00:00 and --to 2022-11-22T00:00:00 in my local time zone for files given as CLI arguments but in UTC for logs given on the standard input.

Or to ignore the offset in logs given on stdin?

Expected behavior

I'd like mlogfilter to always use my local time zone.

Actual/current behavior

➜  mongo cat my.log
2022-11-22T00:00:02.933+0100 I NETWORK [listener] connection accepted from 1.2.3.4:36032 #96426 (121 connections now open)
➜  mongo
➜  mongo mlogfilter my.log --from 2022-11-22T00:00:00 
2022-11-22T00:00:02.933+0100 I NETWORK [listener] connection accepted from 1.2.3.4:36032 #96426 (121 connections now open)
➜  mongo <my.log mlogfilter --from 2022-11-22T00:00:00 
➜  mongo <my.log mlogfilter --from 2022-11-21T23:00:00 
2022-11-22T00:00:02.933+0100 I NETWORK [listener] connection accepted from 1.2.3.4:36032 #96426 (121 connections now open)
➜  mongo
➜  mongo <my.log mlogfilter --timezone 1 --from 2022-11-22T00:00:00 --to 2022-11-22T01:00:00
2022-11-22T01:00:02.933+0100 I NETWORK [listener] connection accepted from 1.2.3.4:36032 #96426 (121 connections now open)
➜  mongo mlogfilter my.log --timezone 1 --from 2022-11-22T00:00:00 --to 2022-11-22T01:00:00
➜  mongo 

Environment

➜  mongo mlogfilter --version                                                              
mtools version 1.7.2 || Python 3.10.8 (main, Oct 13 2022, 09:48:40) [Clang 14.0.0 (clang-1400.0.29.102)]
Software Version
mtools 1.7.2
Python 3.10.8
MongoDB server 4.2.19
Operating system (my laptop, not the server) macOS Monterey 12.6.1
@nahoj nahoj added the question label Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant