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

Add support for Enterprise log redaction #854

Open
stennie opened this issue Mar 22, 2022 · 0 comments
Open

Add support for Enterprise log redaction #854

stennie opened this issue Mar 22, 2022 · 0 comments

Comments

@stennie
Copy link
Collaborator

stennie commented Mar 22, 2022

The Log Redaction feature in MongoDB Enterprise (3.4+) redacts messages associated with any given log event before logging, leaving only metadata, source files, or line numbers related to the event.

Values replaced with ### placeholders are not expected by mtools' log parsing (as at 1.7.0) and will cause unhandled exceptions, eg:

Traceback (most recent call last):
 File “/usr/local/lib/python3.9/site-packages/mtools/util/logevent.py”, line 833, in _extract_counters
  vars(self)[‘_’ + counter] = int((token.split(‘:’)
ValueError: invalid literal for int() with base 10: ‘’
​
During handling of the above exception, another exception occurred:
​
Traceback (most recent call last):
 File “/usr/local/bin/mloginfo”, line 8, in <module>
  sys.exit(main())
 File “/usr/local/lib/python3.9/site-packages/mtools/mloginfo/mloginfo.py”, line 112, in main
  tool.run()
 File “/usr/local/lib/python3.9/site-packages/mtools/mloginfo/mloginfo.py”, line 107, in run
  section.run()
 File “/usr/local/lib/python3.9/site-packages/mtools/mloginfo/sections/query_section.py”, line 92, in run
  allowDiskUse=le.allowDiskUse)
 File “/usr/local/lib/python3.9/site-packages/mtools/util/logevent.py”, line 678, in allowDiskUse
  self._extract_counters()
 File “/usr/local/lib/python3.9/site-packages/mtools/util/logevent.py”, line 884, in _extract_counters
  self._txnNumber = int((split_tokens[t + 1 + self.datetime_nextpos + 2]).replace(‘,’, ‘’))
ValueError: invalid literal for int() with base 10: ‘“###“’
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

1 participant