This sample application generates Online Transaction log entries in the following format:
[ip_address], [user_id], [timestamp], [purchase_amount], [transaction_id], [credit_card_no], [order_no]
where:
ip_addressis a valid IP address from the complete IP address spaceuser_idis an integer between 1 and 100 Million by default; upper count can be changedtimestampis a timestamp in ISO 8601 format (yyyy-MM-ddTHH:MM:SSZ)purchase_amountis a float with two decimal points precisiontransaction_idis a UUIDcredit_card_nois a masked credit card number in the following format:****-****-****-NNNNfor MasterCard and Visa credit card numbers****-******-*NNNNfor American Express credit card numbers
order_nois a 6 characters string with random digits and letters in uppercase
Example log entry looks like this:
106.209.197.154,164605,2016-08-01T00:00:02Z,3093.82,684aa7fe-ab87-4862-b373-097375561aa1,****-****-****-0988,973EV1
The script works in two different modes:
- Historical transactions generator - Generates online transactions data between two specified dates. For this mode you need to specify how many transaction entries you would like to generate (default is 1M). It sends the data to the standard output but will stop when the maximum is reached
- Stream of online transactions - In this mode it continuously generates transactions with the current timestamp and sends them to the standard output
You can start the script directly by using: $ python ./python/olt_generatory.py
from a location where this README.md file is located or you can run the script in Docker.