-
Notifications
You must be signed in to change notification settings - Fork 0
/
jeson-log.py
40 lines (31 loc) · 1002 Bytes
/
jeson-log.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python3
# =============================================================================
# |<-- Note -->|
# This is key:value pairs log generator python script
# 1.id
# 2.start_datetime
# 3.end_datetime
# 4.MSISDN
# 5.SHORT_CODE
# 6.USER_NAME
# =============================================================================
import datetime
import names
import random
import json
# Extra Minutes Generator
extraMinutes = random.randrange(5, 10)
# Value variablesvim
startDate = datetime.datetime.now().replace(microsecond=0)
endDate = startDate + datetime.timedelta(minutes=extraMinutes)
MSISDN = random.randrange(771000001, 771000005)
shortCode = random.randrange(110, 120)
userName = names.get_full_name()
# Print The logfile
randomLog = {"start date": str(startDate), "End Date": str(endDate), "msisdn": MSISDN, "Short Code": shortCode, "user name": userName}
print(json.dumps(randomLog))
# Loop log file printing
i = 0
while i < 10:
print(json.dumps(randomLog))
i += 1