user2710961
user2710961

Reputation: 69

How to parse ISO8583 message from a text file & write it to a database

I am having few ISO8583 logs in a text file. I want to parse these logs from this text file and write them to any database with some descriptive information such as class of the message, message function, message origin, processing code, response code etc.

I am new to the BASE24/ISO8583 and was trying to find any ready-made parser for this. Is there any such parser available ? Does jPOS provides such functionality ?

EDIT

I have the logs in ISO8583 format in ".log" file as given below:

MTI : 0200
Field-3 : 201234
Field-4 : 000000010000
Field-7 : 0110722180
Field-11 : 123456
Field-44 : A5DFGR
Field-105 : ABCDEFGHIJ 1234567890

This is same as the format given in the link shared by you. It also consists of hex dump but I dont want to parse that.

The code given in the link is doing packing and unpacking of the message where as what I am trying is to read these logs (in unpacked form) and write them into a database table.

I think i need to write my own code for this and use the jPOS packagers in it.

Upvotes: 1

Views: 3264

Answers (4)

jan
jan

Reputation: 55

what is displayed in log file is parsed ISO.Hence you need not use jpos.jpos is only for packing and unpacking when you transmit the message. Assign the field to variable and write in DB for example,Field 39 is response code.

Upvotes: 1

Amit Vujic
Amit Vujic

Reputation: 1788

Using jpos is good idea. You should go for your custom packager design class.

Upvotes: 0

apr
apr

Reputation: 1343

Those human-readable log formats are usually difficult to parse without loosing information. Moreover, the logs are probably PCI compliant so there's a lot of masked information there. You want to ask for ah hex dump of the messages.

Upvotes: 1

David Bergert
David Bergert

Reputation: 131

It really depends on the format of the log file - are the ISO8583 messages - HexStrings, and HexDump an XML representation of ISO8583, some other application trace file ?

Once you know the format and it might require some massaging - you will want to research the ISOMsg.unpack() methods using the appropriate jPOS packager. the packager defines the field structure - of the various ISO8583 fields and field construction (lengths, character set, etc.)

a good example was found at the following blog post: looking at the "Parse (unpack) ISO Message" seciton http://jimmod.com/blog/2011/07/26/jimmys-blog-iso-8583-tutorial-build-and-parse-iso-message-using-jpos-library/

You mention - Base24 - jPOS does have a few packagers that might be close starting point.: https://github.com/jpos/jPOS/blob/master/jpos/src/dist/cfg/packager/base24.xml

Upvotes: 2

Related Questions