5

I have an Ubuntu 18.04 server that is running a service I'm developing. The output is being sent to the system journal for logging.

I accidentally failed to sanitize some logging and a plaintext password (for my own user) was accidentally leaked in the logs.

I have fixed the service's logging behavior. Now I simply want to edit the journal files to remove the lines with the plaintext password.

How do I edit a journalctl file?

  • Related unix.stackexchange.com/q/139513/7453 – slm Jul 10 '18 at 22:48
  • Possible dup unix.stackexchange.com/q/272662/7453 – slm Jul 10 '18 at 22:52
  • askubuntu.com/q/864722/17531 shows the paths where logs are stored. I'd look there for your line and use an editor to delete what you want. – slm Jul 10 '18 at 23:00
  • In respect of that last, slm: You seem to be unaware of one of the most famous aspects of systemd's journal files, which ironically makes the explicit question here also the response to your question comment. (-: – JdeBP Jul 11 '18 at 6:38
  • 1
    It must be possible. It should at least be possible to scan the entire journal, grep -v out whatever I don't need, and then write all of the results to a new journal file. There is nothing technically preventing that from happening. It's just that there doesn't appear to be an existing tool to do the job. – Ashoat Jul 12 '18 at 3:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.