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

mloginfo: Print timezone info if parsing >= 2.6 log #258

Closed
gianpaj opened this issue Jul 30, 2014 · 4 comments
Closed

mloginfo: Print timezone info if parsing >= 2.6 log #258

gianpaj opened this issue Jul 30, 2014 · 4 comments
Assignees
Milestone

Comments

@gianpaj
Copy link
Contributor

gianpaj commented Jul 30, 2014

For example:

2014-06-25T22:32:27.098+0000 [initandlisten] MongoDB starting : pid=10448 port=10002 dbpath=/data2000iops/db/ 64-bit host=MongoDB-PRI
2014-06-25T22:32:27.098+0000 [initandlisten] db version v2.6.3
2014-06-25T22:32:27.098+0000 [initandlisten] git version: 255f67a66f9603c59380b2a389e386910bbb52cb
2014-06-25T22:32:27.098+0000 [initandlisten] build info: Linux build12.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2014-06-25T22:32:27.098+0000 [initandlisten] allocator: tcmalloc
2014-06-25T22:32:27.098+0000 [initandlisten] options: { net: { http: { RESTInterfaceEnabled: true, enabled: true }, port: 10002 }, processManagement: { fork: true }, replication: { replSet: "firstset" }, security: { keyFile: "/data2000iops/adminkey" }, storage: { dbPath: "/data2000iops/db/" }, systemLog: { destination: "file", path: "/data2000iops/log/data2000iops.log" } }
2014-06-25T22:32:27.109+0000 [initandlisten] journal dir=/data2000iops/db/journal
2014-06-25T22:32:27.109+0000 [initandlisten] recover : no journal files present, no recovery needed
2014-06-25T22:32:30.201+0000 [initandlisten] waiting for connections on port 10002
2014-06-25T22:32:30.201+0000 [websvr] admin web console waiting for connections on port 11002
$ mloginfo test.log
     source: test.log
      start: 2014 Jun 25 22:32:27.098
        end: 2014 Jun 25 22:32:30.201
date format: iso8601-local
     length: 10
     binary: mongod
    version: 2.6.3
mloginfo test.log --restarts
     source: test.log
      start: 2014 Jun 25 22:32:27.098
        end: 2014 Jun 25 22:32:30.201
date format: iso8601-local
     length: 10
     binary: mongod
    version: 2.6.3

RESTARTS
   Jun 25 22:32:27 version 2.6.3
@rueckstiess
Copy link
Owner

Do you mean something like:

timezone: UTC -0400

@gianpaj
Copy link
Contributor Author

gianpaj commented Jul 31, 2014

For the summary yes.
Similarly there could be a --timezone setting that would print any times with that timezone.

For example if one log is UCT -4 and another UTC -5 and you say:

mloginfo mongod-countryA.log mongod-countryB.log --timezone 0100

then it would output any date by converting any time to that specified timezone

@rueckstiess
Copy link
Owner

Your second feature request "shift logfiles by timezone" is already implemented in mlogfilter.

--timezone [N [N ...]]
                        timezone adjustments: add N hours to corresponding log
                        file, single value for global adjustment.

@gianpaj
Copy link
Contributor Author

gianpaj commented Aug 1, 2014

oh brilliant

@stennie stennie added this to the 1.6.1 milestone Dec 28, 2019
stennie added a commit to stennie/mtools that referenced this issue Dec 28, 2019
@stennie stennie self-assigned this Dec 28, 2019
bugre added a commit to bugre/mtools that referenced this issue Jan 5, 2020
…_JSONSerialize_crash_w_bytes

* 'develop' of github.com:bugre/mtools:
  Add VSCode config to .gitignore
  Bump dev version
  Update for 1.6.1 release
  Fix Flake8 complaints
  Fix rueckstiess#765: mloginfo --clients: more robust parsing of client metadata (rueckstiess#766)
  Fix rueckstiess#761: mtools should use python3 in shebangs
  Fix rueckstiess#698: Add rounding option for mloginfo --queries (rueckstiess#758)
  More specific match for checkpoint duration log line
  Fix rueckstiess#258: Add timezone to mloginfo summary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants