First, thank you for clearly illustrating input data and desired output. Note that join is a performance killer and best avoided; in this case it is an overkill. If I decipher your requirement from...
See more...
First, thank you for clearly illustrating input data and desired output. Note that join is a performance killer and best avoided; in this case it is an overkill. If I decipher your requirement from the complex SPL correctly, all you want is a correlation between INFO and ERROR logs to output exceptions correlated with failed claim, file, etc. Whereas it is not difficult to extract claim number from both types of logs given the illustrated format, an easier correlation field is SessionID because they appear in both types in the exact same form. Additionally, there should be no need to extract clmNumber and confirmationNumber because they are automatically extracted. the name field is garbled because of unquoted white spaces. This is a simpler search that should satisfy your requirement: index="myindex" ("/app1/service/site/upload failed" AND "source=Web" AND "confirmationNumber=ND_*")
OR ("Exception from executeScript")
| rex "\bname=(?<name>[^,]+)"
```| rex "clmNumber=(?<ClaimNumber>[^,]+)"
| rex "confirmationNumber=(?<SubmissionNumber>[^},]+)"
| rex "contentType=(?<ContentType>[^},]+)" ```
| rex "(?<SessionID>\[http-nio-8080-exec-\d+\])"
| rex "Exception from executeScript: (?<Exception>[^:]+)"
| fields clmNumber confirmationNumber name Exception SessionID
| stats min(_time) as _time values(*) as * by SessionID Your sample logs should give SessionID _time Exception clmNumber confirmationNumber name [http-nio-8080-exec-200] 2024-02-15 09:41:16.762 0115100953 Document not found - Tristian CLAIM #99900470018 PACKAGE.pdf 99900470018 ND_52233-02152024 Tristian CLAIM #99900470018 PACKAGE.pdf [http-nio-8080-exec-202] 2024-02-15 09:07:47.769 0115100898 Duplicate Child Exception - ROAMN Claim # 99900468430 Invoice.pdf already exists in the location. 99900468430 ND_50249-02152024 ROAMN Claim # 99900468430 Invoice.pdf Of course you can remove SessionID from display and rearrange field order. You can play with the following emulation and compare with real data | makeresults
| eval data = split("2024-02-15 09:07:47,770 INFO [com.mysite.core.app1.upload.FileUploadWebScript] [http-nio-8080-exec-202] The Upload Service /app1/service/site/upload failed in 0.124000 seconds, {comments=xxx-123, senderCompany=Company1, source=Web, title=Submitted via Site website, submitterType=Others, senderName=ROMAN , confirmationNumber=ND_50249-02152024, clmNumber=99900468430, name=ROAMN Claim # 99900468430 Invoice.pdf, contentType=Email}
2024-02-15 09:07:47,772 ERROR [org.springframework.extensions.webscripts.AbstractRuntime] [http-nio-8080-exec-202] Exception from executeScript: 0115100898 Duplicate Child Exception - ROAMN Claim # 99900468430 Invoice.pdf already exists in the location.
---
---
---
2024-02-15 09:41:16,762 INFO [com.mysite.core.app1.upload.FileUploadWebScript] [http-nio-8080-exec-200] The Upload Service /app1/service/site/upload failed in 0.138000 seconds, {comments=yyy-789, senderCompany=Company2, source=Web, title=Submitted via Site website, submitterType=Public Adjuster, senderName=Tristian, confirmationNumber=ND_52233-02152024, clmNumber=99900470018, name=Tristian CLAIM #99900470018 PACKAGE.pdf, contentType=Email}
2024-02-15 09:41:16,764 ERROR [org.springframework.extensions.webscripts.AbstractRuntime] [http-nio-8080-exec-200] Exception from executeScript: 0115100953 Document not found - Tristian CLAIM #99900470018 PACKAGE.pdf", "
")
| mvexpand data
| rename data AS _raw
| rex "^(?<_time>\S+ \S+)"
| eval _time = strptime(_time, "%F %T,%3N")
| extract
``` the above emulates
(index="myindex" "/app1/service/site/upload failed" AND "source=Web" AND "confirmationNumber=ND_*") OR
(index="myindex" "Exception from executeScript")
```
| rex "\bname=(?<name>[^,]+)"
```| rex "clmNumber=(?<ClaimNumber>[^,]+)"
| rex "confirmationNumber=(?<SubmissionNumber>[^},]+)"
| rex "contentType=(?<ContentType>[^},]+)" ```
| rex "(?<SessionID>\[http-nio-8080-exec-\d+\])"
| rex "Exception from executeScript: (?<Exception>[^:]+)"
| fields clmNumber confirmationNumber name Exception SessionID
| stats min(_time) as _time values(*) as * by SessionID