1

I'm currently working on a parser for plaso. For this I need to read journald's binary log files and convert those to a plaso timeline object.

My question now is: How do I read a binary file in python, keeping in mind that the file may contain strings and integers. Is a byte array sufficient for this? If so, how can I find the correct delimiters for the message fields?

Since I'm new to python I can't provide useful code just yet, still trying to wrap my head around this.

1 Answers1

1

You can deal with binary data using struct package.

If I had been you I would have seen the struct of the file by journald (from journald docs or its source code) and parsed binary data into fields.

Deck
  • 1,929
  • 4
  • 20
  • 40