fork download
  1. import re
  2.  
  3. pattern = re.compile(r'(?:port (\d+))|(?:Logon ID:\s+(\w+)\s+Logon)')
  4.  
  5. s = '''
  6. 2019-07-09 14:39:36,592 - /Volumes/unix/workplace/Inprogress/AMSReplaceBastions_test.py[line:93] - INFO: [Security] [4634] [Microsoft-Windows-Security-Auditing] [WIN] [An account was logged off.
  7.  
  8. Subject:
  9. Security ID: S-1-5-21-2699825732-1888650521-3855454274-2782
  10. Account Name: administartor
  11. Account Domain: test
  12. Logon ID: 0x6800CD4
  13.  
  14. Logon Type: 10
  15.  
  16. Starting session: shell on pts/0 for root from 10.0.0.70 port 45912 id 0
  17. '''
  18.  
  19. print(pattern.findall(s))
  20.  
  21.  
Success #stdin #stdout 0.01s 27728KB
stdin
Standard input is empty
stdout
[('', '0x6800CD4'), ('45912', '')]