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 reports host name as unknown for 3.6 logs #819

Closed
niccottrell opened this issue Sep 15, 2020 · 2 comments
Closed

mloginfo reports host name as unknown for 3.6 logs #819

niccottrell opened this issue Sep 15, 2020 · 2 comments
Assignees
Milestone

Comments

@niccottrell
Copy link

Expected behavior

mloginfo should report the host name extracted from the logs

Actual/current behavior

  • reports the host as unknown

Steps to reproduce the actual/current behavior

Run on a log file starting with:

2020-09-07T19:00:36.263+0100 I CONTROL  [conn71088] pid=55156 port=27120 64-bit host=xyz10498n01

output starts with:

(base) [nic:~/Downloads/xyz]$ mloginfo --clients xyz/*                     
     source: xyz/server_mongosd.log.2020-09-06T08-00-40
       host: unknown
      start: 2020 Sep 05 09:00:17.976
        end: 2020 Sep 06 09:00:40.003
date format: iso8601-local

Environment

Software Version
mtools mtools version 1.6.4
Python Python 3.7.6 (default, Jan 8 2020, 13:42:34) [Clang 4.0.1 (tags/RELEASE_401/final)]
MongoDB server db version v3.6.16
Operating system macOS
@niccottrell
Copy link
Author

I think it's this line:

if "starting :" in line or "starting:" in line:

There's no "starting" in the 3.6 logs. How about

            if ln == 0 or "starting :" in line or "starting:" in line:
``

@stennie stennie added this to the 1.7.0 milestone Sep 16, 2020
@stennie stennie self-assigned this Sep 16, 2020
@stennie
Copy link
Collaborator

stennie commented Oct 12, 2020

There's no "starting" in the 3.6 logs.

@niccottrell The "starting" match is looking for known restarts, which is still correct for 3.6 (normally from an initandlisten thread).

However, the alternative example you found works as a fall back for finding the host and port details from another thread.

The current match checks even if the hostname is already set, but since only one hostname is reported I'll only check if hostname isn't already set.

Cheers,
Stennie

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

2 participants