I have a log coming in from an application. I'll include a sample of the log and what I am looking for. I want to create an alert based on several items and be able to include some of them in the email alert. Problem is, they come into the system one line at a time. Is there a way I can capture these and have them be included into one line to parse and pull needed info from?
Log entry:
If the "DoesNotExist: No assets match query " and the "ERROR: <Response [500]> are there I need all the info between the "INFO:" lines and grab things like AssocBill number and filename.2018-01-08 17:00:54,971 __main__ DEBUG: received request - request metadata is: {'sentTime': '2018-01-08T16:00:54', 'replyTo': None, 'memo': None, 'md5sum': 'afd045c391fd14c2a814c772588cbb0d', 'senderId': '30587',
'messageType': None, 'messageId': '24c02482-d604-46bf-95ff-b7d41ae572fd', 'correlationId': None}
2018-01-08 17:00:54,971 __main__ DEBUG: request body: <lm_integration><path>h:\viewfn\18NOTES\HB\HB1160.001</path><type>FN</type><use_oracle>True</use_oracle><dictionary>{AssocBill:IN1160.1}</dictionary></lm_integr
ation>
2018-01-08 17:00:54,971 __main__ DEBUG: job type: FN
2018-01-08 17:00:54,972 __main__ DEBUG: AssocBill:IN1160.1
2018-01-08 17:00:54,972 __main__ DEBUG: ['AssocBill:IN1160.1']
2018-01-08 17:00:54,972 __main__ DEBUG: {'AssocBill': 'IN1160.1'}
2018-01-08 17:00:54,972 __main__ DEBUG: filename: HB1160.001
2018-01-08 17:00:54,972 __main__ DEBUG: parent_directory: HB
2018-01-08 17:00:54,972 __main__ DEBUG: document prefix: HB, document number: 1160.001
2018-01-08 17:00:54,972 __main__ DEBUG: FN
2018-01-08 17:00:54,972 __main__ DEBUG: /mnt/VIEWFN/18NOTES/HB/HB1160.001
2018-01-08 17:00:54,972 __main__ DEBUG: http://igarh7tstwebapp/lm/lm/upload_fn/
2018-01-08 17:00:56,435 __main__ ERROR: ---TRACEBACK RETURNED FROM SERVER---:
Traceback (most recent call last):
File "/opt/lrms/envs/in1_lm_webapp/lib/python2.7/site-packages/lm_webapp/lm_webapp/lm/views.py", line 494, in upload_fn
bill = Bill.objects.get(legacyid=bill_version)
File "/opt/lrms/envs/in1_lm_webapp/lib/python2.7/site-packages/joplin/models/manager.py", line 81, in get
kwargs.pop("revno", DEFAULT_REVNO)).get(*args, **kwargs)
File "/opt/lrms/envs/in1_lm_webapp/lib/python2.7/site-packages/joplin/models/query.py", line 342, in get
% str(queryset.query))
DoesNotExist: No assets matched query: (AND: ('apn__isnull', 'False'), ('legacyid__exact', "u'IN1160.1'"))
2018-01-08 17:00:56,435 __main__ ERROR: <Response [500]>
2018-01-08 17:00:56,435 __main__ INFO: waiting for requests on queue 'lm_integration'
2018-01-09 16:13:57,958 __main__ DEBUG: received request - request metadata is: {'sentTime': '2018-01-09T15:13:57', 'replyTo': None, 'memo': None, 'md5sum': '3360919b5e19369511b61195810a8055', 'senderId': '11443',
'messageType': None, 'messageId': 'a7a62d4c-3236-41a0-a0a1-53281add04c6', 'correlationId': None}
2018-01-09 16:13:57,959 __main__ DEBUG: request body: <lm_integration><path>H:\VIEWFN\18NOTES\HB\HB1015.002</path><type>FN</type><use_oracle>True</use_oracle><dictionary>{AssocBill:IN1015.2}</dictionary></lm_integr
ation>
2018-01-09 16:13:57,959 __main__ DEBUG: job type: FN
2018-01-09 16:13:57,959 __main__ DEBUG: AssocBill:IN1015.2
2018-01-09 16:13:57,959 __main__ DEBUG: ['AssocBill:IN1015.2']
2018-01-09 16:13:57,959 __main__ DEBUG: {'AssocBill': 'IN1015.2'}
2018-01-09 16:13:57,959 __main__ DEBUG: filename: HB1015.002
2018-01-09 16:13:57,959 __main__ DEBUG: parent_directory: HB
2018-01-09 16:13:57,960 __main__ DEBUG: document prefix: HB, document number: 1015.002
2018-01-09 16:13:57,960 __main__ DEBUG: FN
2018-01-09 16:13:57,960 __main__ DEBUG: /mnt/VIEWFN/18NOTES/HB/HB1015.002
2018-01-09 16:13:57,960 __main__ DEBUG: http://igarh7tstwebapp/lm/lm/upload_fn/
2018-01-09 16:13:59,392 __main__ ERROR: ---TRACEBACK RETURNED FROM SERVER---:
Traceback (most recent call last):
File "/opt/lrms/envs/in1_lm_webapp/lib/python2.7/site-packages/lm_webapp/lm_webapp/lm/views.py", line 494, in upload_fn
bill = Bill.objects.get(legacyid=bill_version)
File "/opt/lrms/envs/in1_lm_webapp/lib/python2.7/site-packages/joplin/models/manager.py", line 81, in get
kwargs.pop("revno", DEFAULT_REVNO)).get(*args, **kwargs)
File "/opt/lrms/envs/in1_lm_webapp/lib/python2.7/site-packages/joplin/models/query.py", line 342, in get
% str(queryset.query))
DoesNotExist: No assets matched query: (AND: ('apn__isnull', 'False'), ('legacyid__exact', "u'IN1015.2'"))
2018-01-09 16:13:59,392 __main__ ERROR: <Response [500]>
2018-01-09 16:13:59,392 __main__ INFO: waiting for requests on queue 'lm_integration'
Thanks.