3

I am building a tool to replay logs. Manually parsing the logs is annoying, so I'm wondering if there is a way to simply load a message from the log.

Also, I am not against just using a third-party replay tool if one exists.

Jonathan Allen
  • 68,373
  • 70
  • 259
  • 447
  • Which logs? *.messages.current.log (or *.messages.log in older versions of QuickFIX)? Or the ones from the FileStore? Do you even use one or both of these optional parts of QuickFIX (they're available via your configuration file). – John Zwinck Jan 17 '10 at 01:10
  • Whatever logs you tell me to use, I'm not picky and have access to all of them. – Jonathan Allen Jan 17 '10 at 09:14
  • Could you clarify what you mean by "replay"? Do you want a log-viewer that will let you look at the messages for a session in a nice format, or an application that can parse and then fire the historic messages into another FIX session? – Ani Jan 26 '11 at 08:43
  • 1
    I wanted "application that can parse and then fire the historic messages into another FIX session". – Jonathan Allen Jan 30 '11 at 19:46
  • 1
    Since the original question could have been interpreted differently (now clarified in the comment) I've found [hffix](https://github.com/jamesdbrock/hffix) to be a very useful command line tool for replaying FIX logs in human readable format. – Stephen Morrell Dec 20 '18 at 14:46

2 Answers2

8

First read the log file by any mean you want, getting the individual lines (there is one message per line).

Then build a Data Dictionary:

// Use the version of the XML dictionary that is right for you
FIX::DataDictionary dd("FIX44.XML");

Then, for each line (as std::string str), build a message:

FIX::Message msg(str, dd, false);

Finally, handle the message just like your FIX::Application does, or better, call

yourFixApplication.fromApp(msg, mySessionID);
Gabriel
  • 2,841
  • 4
  • 33
  • 43
  • 2
    You may or may not want to also update any timestamp fields in the messages. – shaz Jul 30 '16 at 12:34
  • How would you parse the resulting message? I am looking for `quickfix` documentation of the `Message` class and cannot seem to find anywhere -- the general doc does not seem to reference it... – gt6989b Apr 17 '18 at 15:45
3

ValidFIX Log analyzer is an online log parser that makes a good job: http://www.validfix.com/fix-log-analyzer.html

MichaelS
  • 7,023
  • 10
  • 51
  • 75
  • 2
    That used to be free but now its commercial. It's a great tool, effective, quick, web based. But now it's expensive for an individual. But for a company it seems great because it has unlimited uses and unlimited users. – Wayne Mar 13 '12 at 12:43
  • 2
    If the need is to quickly display FIX in a human readable format, try the FIX parser at http://fixparser.targetcompid.com – Shahbaz Feb 07 '13 at 04:37
  • as well as https://fixparser.targetcompid.com there is also https://fixparser.chronicle.software – Rob Austin Aug 29 '21 at 06:00