<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Searching data from two subsequent events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Searching-data-from-two-subsequent-events/m-p/677915#M231824</link>
    <description>&lt;P&gt;Result is coming like this for the first query.....&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%"&gt;SessionID&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;_time&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;Exception&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;clmNumber&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;confirmationNumber&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%"&gt;[http-nio-8080-exec-101]&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;2024-02-15 00:06:38.457&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;&lt;P&gt;0115100018 Could not match parameter list [names, keep] to an operation.&lt;BR /&gt;org.springframework.extensions.webscripts.WebScriptException&lt;BR /&gt;0115100062 Could not find document 20231009_00064.TIF in suspense.&lt;BR /&gt;org.springframework.extensions.webscripts.WebScriptException&lt;BR /&gt;0115100104 Could not find document 20240103_00065.TIF in suspense.&lt;BR /&gt;org.springframework.extensions.webscripts.WebScriptException&lt;BR /&gt;0115100168 Duplicate Child Exception - 02142024_17C0_Email.pdf already exists in the location.&lt;BR /&gt;org.springframework.extensions.webscripts.WebScriptException&lt;BR /&gt;0115100375 Duplicate Child Exception - NB Doc Form 313652.8.24 already exists in the location.&lt;BR /&gt;org.springframework.extensions.webscripts.WebScriptException&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;(Many More)&lt;/P&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 17 Feb 2024 16:22:08 GMT</pubDate>
    <dc:creator>runiyal</dc:creator>
    <dc:date>2024-02-17T16:22:08Z</dc:date>
    <item>
      <title>Searching data from two subsequent events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-data-from-two-subsequent-events/m-p/677810#M231769</link>
      <description>&lt;P&gt;I have a logfile like this -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;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 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We need to look at index=&amp;lt;myindex&amp;gt; "/alfresco/service/site/upload failed" and get the table with the following information.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="20%" height="25px"&gt;_time&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;clmNumber&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;confirmationNumber&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;name&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;Exception&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%" height="69px"&gt;2024-02-15 09:07:47&lt;/TD&gt;&lt;TD width="20%" height="69px"&gt;99900468430&lt;/TD&gt;&lt;TD width="20%" height="69px"&gt;ND_50249-02152024&lt;/TD&gt;&lt;TD width="20%" height="69px"&gt;ROMAN Claim # 99900468430 Invoice.pdf&lt;/TD&gt;&lt;TD width="20%" height="69px"&gt;0115100898 Duplicate Child Exception - ROAMN Claim # 99900468430 Invoice.pdf already exists in the location&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%" height="69px"&gt;2024-02-15 09:41:16&lt;/TD&gt;&lt;TD width="20%" height="69px"&gt;99900470018&lt;/TD&gt;&lt;TD width="20%" height="69px"&gt;ND_52233-02152024&lt;/TD&gt;&lt;TD width="20%" height="69px"&gt;Tristian CLAIM #99900470018 PACKAGE.pdf&lt;/TD&gt;&lt;TD width="20%" height="69px"&gt;0115100953 Document not found - Tristian CLAIM #99900470018 PACKAGE.pdf&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Exception is in another event line in logfile but just after the line from where to get first 4 metadata. Both of the rows/ events in the logs have sessionID in common and can have DOCNAME also in common but SessionID can have multiple transactions so can have different name.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created following script for this purpose but its providing different DocName&amp;nbsp; -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index="myindex" "/app1/service/site/upload failed" AND "source=Web" AND "confirmationNumber=ND_*") OR 
(index="myindex" "Exception from executeScript")
| rex "clmNumber=(?&amp;lt;ClaimNumber&amp;gt;[^,]+)" 
| rex "confirmationNumber=(?&amp;lt;SubmissionNumber&amp;gt;[^},]+)" 
| rex "contentType=(?&amp;lt;ContentType&amp;gt;[^},]+)" 
| rex "name=(?&amp;lt;DocName&amp;gt;[^,]+)" 
| rex "(?&amp;lt;SessionID&amp;gt;\[http-nio-8080-exec-\d+\])" 
| eval EventType=if(match(_raw, "Exception from executeScript"), "Exception", "Upload Failure")
| eventstats first(EventType) as first_EventType by SessionID
| where EventType="Upload Failure"
| join type=outer SessionID [
    search index="myindex" "Exception from executeScript"
    | rex "Exception from executeScript: (?&amp;lt;Exception&amp;gt;[^:]+)"
    | rex "(?&amp;lt;SessionID&amp;gt;\[http-nio-8080-exec-\d+\])"
    | rex "(?&amp;lt;ExceptionDocName&amp;gt;.+\.pdf)"
    | eval EventType="Exception"
    | eventstats first(EventType) as first_EventType by SessionID
] 
| where EventType="Exception" OR isnull(Exception)
| table _time, ClaimNumber, SubmissionNumber, ContentType, DocName, Exception
| sort _time desc ClaimNumber&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the result that I got -&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="20%" height="25px"&gt;_time&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;clmNumber&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;confirmationNumber&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;name&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;Exception&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%" height="69px"&gt;2024-02-15 09:07:47&lt;/TD&gt;&lt;TD width="20%" height="69px"&gt;99900468430&lt;/TD&gt;&lt;TD width="20%" height="69px"&gt;ND_50249-02152024&lt;/TD&gt;&lt;TD width="20%" height="69px"&gt;ROMAN Claim # 99900468430 Invoice.pdf&lt;/TD&gt;&lt;TD width="20%" height="69px"&gt;0115105149 Duplicate Child Exception - Rakesh lease 4 already exists in the location.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%" height="69px"&gt;2024-02-15 09:41:16&lt;/TD&gt;&lt;TD width="20%" height="69px"&gt;99900470018&lt;/TD&gt;&lt;TD width="20%" height="69px"&gt;ND_52233-02152024&lt;/TD&gt;&lt;TD width="20%" height="69px"&gt;Tristian CLAIM #99900470018 PACKAGE.pdf&lt;/TD&gt;&lt;TD width="20%" height="69px"&gt;0115105128 Duplicate Child Exception - Combined 4 Point signed Ramesh 399 Coral Island. disk 3 already exists in the location.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, although I am able to get first four metadata in the table correctly, but the exception is coming from another event in the log with same sessionID I believe.&lt;/P&gt;&lt;P&gt;How can we fix the script to provide the expected result?&lt;/P&gt;&lt;P&gt;Thanks in Advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 14:58:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-data-from-two-subsequent-events/m-p/677810#M231769</guid>
      <dc:creator>runiyal</dc:creator>
      <dc:date>2024-02-16T14:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Searching data from two subsequent events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-data-from-two-subsequent-events/m-p/677877#M231804</link>
      <description>&lt;P&gt;First, thank you for clearly illustrating input data and desired output. &amp;nbsp;Note that join is a performance killer and best avoided; in this case it is an overkill.&lt;/P&gt;&lt;P&gt;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. &amp;nbsp;Whereas it is not difficult to extract claim number from both types of logs given the illustrated format, an easier correlation field is &lt;U&gt;SessionID&lt;/U&gt; because they appear in both types in the exact same form.&lt;/P&gt;&lt;P&gt;Additionally, there should be no need to extract &lt;U&gt;clmNumber&lt;/U&gt; and &lt;U&gt;confirmationNumber&lt;/U&gt; because they are automatically extracted. &amp;nbsp;the &lt;U&gt;name&lt;/U&gt; field is garbled because of unquoted white spaces.&lt;/P&gt;&lt;P&gt;This is a simpler search that should satisfy your requirement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myindex" ("/app1/service/site/upload failed" AND "source=Web" AND "confirmationNumber=ND_*")
 OR ("Exception from executeScript")
| rex "\bname=(?&amp;lt;name&amp;gt;[^,]+)"
```| rex "clmNumber=(?&amp;lt;ClaimNumber&amp;gt;[^,]+)" 
| rex "confirmationNumber=(?&amp;lt;SubmissionNumber&amp;gt;[^},]+)"
| rex "contentType=(?&amp;lt;ContentType&amp;gt;[^},]+)" ```
| rex "(?&amp;lt;SessionID&amp;gt;\[http-nio-8080-exec-\d+\])"
| rex "Exception from executeScript: (?&amp;lt;Exception&amp;gt;[^:]+)"
| fields clmNumber confirmationNumber name Exception SessionID
| stats min(_time) as _time values(*) as * by SessionID&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your sample logs should give&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;SessionID&lt;/TD&gt;&lt;TD&gt;_time&lt;/TD&gt;&lt;TD&gt;Exception&lt;/TD&gt;&lt;TD&gt;clmNumber&lt;/TD&gt;&lt;TD&gt;confirmationNumber&lt;/TD&gt;&lt;TD&gt;name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;[http-nio-8080-exec-200]&lt;/TD&gt;&lt;TD&gt;2024-02-15 09:41:16.762&lt;/TD&gt;&lt;TD&gt;0115100953 Document not found - Tristian CLAIM #99900470018 PACKAGE.pdf&lt;/TD&gt;&lt;TD&gt;99900470018&lt;/TD&gt;&lt;TD&gt;ND_52233-02152024&lt;/TD&gt;&lt;TD&gt;Tristian CLAIM #99900470018 PACKAGE.pdf&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;[http-nio-8080-exec-202]&lt;/TD&gt;&lt;TD&gt;2024-02-15 09:07:47.769&lt;/TD&gt;&lt;TD&gt;0115100898 Duplicate Child Exception - ROAMN Claim # 99900468430 Invoice.pdf already exists in the location.&lt;/TD&gt;&lt;TD&gt;99900468430&lt;/TD&gt;&lt;TD&gt;ND_50249-02152024&lt;/TD&gt;&lt;TD&gt;ROAMN Claim # 99900468430 Invoice.pdf&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Of course you can remove SessionID from display and rearrange field order.&lt;/P&gt;&lt;P&gt;You can play with the following emulation and compare with real data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| 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 "^(?&amp;lt;_time&amp;gt;\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=(?&amp;lt;name&amp;gt;[^,]+)"
```| rex "clmNumber=(?&amp;lt;ClaimNumber&amp;gt;[^,]+)" 
| rex "confirmationNumber=(?&amp;lt;SubmissionNumber&amp;gt;[^},]+)"
| rex "contentType=(?&amp;lt;ContentType&amp;gt;[^},]+)" ```
| rex "(?&amp;lt;SessionID&amp;gt;\[http-nio-8080-exec-\d+\])"
| rex "Exception from executeScript: (?&amp;lt;Exception&amp;gt;[^:]+)"
| fields clmNumber confirmationNumber name Exception SessionID
| stats min(_time) as _time values(*) as * by SessionID&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2024 01:22:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-data-from-two-subsequent-events/m-p/677877#M231804</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-02-17T01:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: Searching data from two subsequent events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-data-from-two-subsequent-events/m-p/677912#M231821</link>
      <description>&lt;P&gt;Thanks a lot for your reply Yuanliu.&lt;/P&gt;&lt;P&gt;When I tried to run the below code I get very skwed result. Session ID, and Time columns gets populated. For Exception, all exception for that "day" shows up in in row itself (Since I am running a day's worth of report) whether its related to "confirmationNumber=ND_*" or not. Rest of the three fieds are empty.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myindex" ("/app1/service/site/upload failed" AND "source=Web" AND "confirmationNumber=ND_*")
 OR ("Exception from executeScript")
| rex "\bname=(?&amp;lt;name&amp;gt;[^,]+)"
```| rex "clmNumber=(?&amp;lt;ClaimNumber&amp;gt;[^,]+)" 
| rex "confirmationNumber=(?&amp;lt;SubmissionNumber&amp;gt;[^},]+)"
| rex "contentType=(?&amp;lt;ContentType&amp;gt;[^},]+)" ```
| rex "(?&amp;lt;SessionID&amp;gt;\[http-nio-8080-exec-\d+\])"
| rex "Exception from executeScript: (?&amp;lt;Exception&amp;gt;[^:]+)"
| fields clmNumber confirmationNumber name Exception SessionID
| stats min(_time) as _time values(*) as * by SessionID&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Secondly, I have data that might have same sessionID but different dataset, I am not able to see _time for the second transaction for same sessionID. Here is the sample data -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| 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/citizens/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:10:47,770 INFO  [com.mysite.core.app1.upload.FileUploadWebScript] [http-nio-8080-exec-202] The Upload Service /app1/service/citizens/upload failed in 0.124000 seconds, {comments=xxx-123, senderCompany=Company1, source=Web, title=Submitted via Site website, submitterType=Others, senderName=Bob , confirmationNumber=ND_55555-02152024, clmNumber=99900468999, name=Bob Claim # 99900468999 Invoice.pdf, contentType=Email}
2024-02-15 09:10:48,772 ERROR [org.springframework.extensions.webscripts.AbstractRuntime] [http-nio-8080-exec-202] Exception from executeScript: 0115101000 Document not found - Bob Claim # 99900468999 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/citizens/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", "
")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and here is the result -&lt;/P&gt;&lt;TABLE border="1" width="100.00000000000001%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;SessionID&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;_time&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;Exception&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;clmNumber&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;confirmationNumber&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&lt;SPAN&gt;[http-nio-8080-exec-200]&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&lt;SPAN&gt;2024-02-15 09:41:16.762&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;0115100953 Document not found - Tristian CLAIM #99900470018 PACKAGE.pdf&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&lt;SPAN&gt;99900470018&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&lt;SPAN&gt;ND_52233-02152024&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&lt;SPAN&gt;Tristian CLAIM #99900470018 PACKAGE.pdf&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&lt;SPAN&gt;[http-nio-8080-exec-202]&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&lt;SPAN&gt;2024-02-15 09:07:47.769&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&lt;DIV class=""&gt;0115100898 Duplicate Child Exception - ROAMN Claim # 99900468430 Invoice.pdf already exists in the location.&lt;/DIV&gt;&lt;DIV class=""&gt;0115101000 Document not found - Bob Claim # 99900468999 Invoice.pdf already exists in the location.&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&lt;DIV class=""&gt;99900468430&lt;/DIV&gt;&lt;DIV class=""&gt;99900468999&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&lt;DIV class=""&gt;ND_50249-02152024&lt;/DIV&gt;&lt;DIV class=""&gt;ND_55555-02152024&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&lt;DIV class=""&gt;Bob Claim # 99900468999 Invoice.pdf&lt;/DIV&gt;&lt;DIV class=""&gt;ROAMN Claim # 99900468430 Invoice.pdf&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;How can we fix the first query so that it provides data for all columns correctly?&lt;/P&gt;&lt;P&gt;Thanks in advance for your time!&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2024 15:38:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-data-from-two-subsequent-events/m-p/677912#M231821</guid>
      <dc:creator>runiyal</dc:creator>
      <dc:date>2024-02-17T15:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Searching data from two subsequent events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-data-from-two-subsequent-events/m-p/677913#M231822</link>
      <description>&lt;P&gt;BTW when the first query runs, it feels like it is going to give data as it presented by query 2 (| makeresults) for a sub second and then it mixes up and provides all the jumbled up data without anything on last three columns. Not sure if this information helps.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2024 16:09:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-data-from-two-subsequent-events/m-p/677913#M231822</guid>
      <dc:creator>runiyal</dc:creator>
      <dc:date>2024-02-17T16:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Searching data from two subsequent events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-data-from-two-subsequent-events/m-p/677915#M231824</link>
      <description>&lt;P&gt;Result is coming like this for the first query.....&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%"&gt;SessionID&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;_time&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;Exception&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;clmNumber&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;confirmationNumber&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%"&gt;[http-nio-8080-exec-101]&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;2024-02-15 00:06:38.457&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;&lt;P&gt;0115100018 Could not match parameter list [names, keep] to an operation.&lt;BR /&gt;org.springframework.extensions.webscripts.WebScriptException&lt;BR /&gt;0115100062 Could not find document 20231009_00064.TIF in suspense.&lt;BR /&gt;org.springframework.extensions.webscripts.WebScriptException&lt;BR /&gt;0115100104 Could not find document 20240103_00065.TIF in suspense.&lt;BR /&gt;org.springframework.extensions.webscripts.WebScriptException&lt;BR /&gt;0115100168 Duplicate Child Exception - 02142024_17C0_Email.pdf already exists in the location.&lt;BR /&gt;org.springframework.extensions.webscripts.WebScriptException&lt;BR /&gt;0115100375 Duplicate Child Exception - NB Doc Form 313652.8.24 already exists in the location.&lt;BR /&gt;org.springframework.extensions.webscripts.WebScriptException&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;(Many More)&lt;/P&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2024 16:22:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-data-from-two-subsequent-events/m-p/677915#M231824</guid>
      <dc:creator>runiyal</dc:creator>
      <dc:date>2024-02-17T16:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Searching data from two subsequent events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-data-from-two-subsequent-events/m-p/677928#M231833</link>
      <description>&lt;P&gt;Thank you for providing the emulation! &amp;nbsp;It is really important to illustrate data characteristics when dealing with data analytics. &amp;nbsp;I made the assumption that each session would only handle one claim. &amp;nbsp;If that is not the case, we'll have to extract claim number for correlation. &amp;nbsp;There are many ways to do this. Because claim number is always embedded in the file name, I will show the simplest that applies to both INFO and ERROR. (An alternative is to simply use file name for correlation.) &amp;nbsp;So&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index="myindex" "/app1/service/site/upload failed" AND "source=Web" AND "confirmationNumber=ND_*") OR 
(index="myindex" "Exception from executeScript")
| rex "\bname=(?&amp;lt;name&amp;gt;[^,]+)"
| rex "(?i) claim # *(?&amp;lt;claimNumber&amp;gt;\S+)"
| rex "(?&amp;lt;SessionID&amp;gt;\[http-nio-8080-exec-\d+\])"
| rex "Exception from executeScript: (?&amp;lt;Exception&amp;gt;[^:]+)"
| fields claimNumber confirmationNumber name Exception
| stats min(_time) as _time values(*) as * by claimNumber&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Here is full emulation and result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| 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/citizens/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:10:47,770 INFO  [com.mysite.core.app1.upload.FileUploadWebScript] [http-nio-8080-exec-202] The Upload Service /app1/service/citizens/upload failed in 0.124000 seconds, {comments=xxx-123, senderCompany=Company1, source=Web, title=Submitted via Site website, submitterType=Others, senderName=Bob , confirmationNumber=ND_55555-02152024, clmNumber=99900468999, name=Bob Claim # 99900468999 Invoice.pdf, contentType=Email}
2024-02-15 09:10:48,772 ERROR [org.springframework.extensions.webscripts.AbstractRuntime] [http-nio-8080-exec-202] Exception from executeScript: 0115101000 Document not found - Bob Claim # 99900468999 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/citizens/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 "^(?&amp;lt;_time&amp;gt;\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=(?&amp;lt;name&amp;gt;[^,]+)"
| rex "(?i) claim # *(?&amp;lt;claimNumber&amp;gt;\S+)"
```| rex "clmNumber=(?&amp;lt;ClaimNumber&amp;gt;[^,]+)" 
| rex "confirmationNumber=(?&amp;lt;SubmissionNumber&amp;gt;[^},]+)"
| rex "contentType=(?&amp;lt;ContentType&amp;gt;[^},]+)" ```
| rex "(?&amp;lt;SessionID&amp;gt;\[http-nio-8080-exec-\d+\])"
| rex "Exception from executeScript: (?&amp;lt;Exception&amp;gt;[^:]+)"
| fields claimNumber confirmationNumber name Exception
| stats min(_time) as _time values(*) as * by claimNumber&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;claimNumber&lt;/TD&gt;&lt;TD&gt;_time&lt;/TD&gt;&lt;TD&gt;Exception&lt;/TD&gt;&lt;TD&gt;confirmationNumber&lt;/TD&gt;&lt;TD&gt;name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;99900468430&lt;/TD&gt;&lt;TD&gt;2024-02-15 09:07:47.769&lt;/TD&gt;&lt;TD&gt;0115100898 Duplicate Child Exception - ROAMN Claim # 99900468430 Invoice.pdf already exists in the location.&lt;/TD&gt;&lt;TD&gt;ND_50249-02152024&lt;/TD&gt;&lt;TD&gt;ROAMN Claim # 99900468430 Invoice.pdf&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;99900468999&lt;/TD&gt;&lt;TD&gt;2024-02-15 09:10:47.769&lt;/TD&gt;&lt;TD&gt;0115101000 Document not found - Bob Claim # 99900468999 Invoice.pdf already exists in the location.&lt;/TD&gt;&lt;TD&gt;ND_55555-02152024&lt;/TD&gt;&lt;TD&gt;Bob Claim # 99900468999 Invoice.pdf&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;99900470018&lt;/TD&gt;&lt;TD&gt;2024-02-15 09:41:16.762&lt;/TD&gt;&lt;TD&gt;0115100953 Document not found - Tristian CLAIM #99900470018 PACKAGE.pdf&lt;/TD&gt;&lt;TD&gt;ND_52233-02152024&lt;/TD&gt;&lt;TD&gt;Tristian CLAIM #99900470018 PACKAGE.pdf&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Sat, 17 Feb 2024 22:36:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-data-from-two-subsequent-events/m-p/677928#M231833</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-02-17T22:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Searching data from two subsequent events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-data-from-two-subsequent-events/m-p/677991#M231857</link>
      <description>&lt;P&gt;Thanks Yuanliu,&lt;/P&gt;&lt;P&gt;This is working but not completely.&amp;nbsp;There are 75 records that I should get in the resilt get as I am getting 75 rows if I just search for&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myindex" "/app1/service/site/upload failed" AND "source=Web" AND "confirmationNumber=ND_*"&lt;/LI-CODE&gt;&lt;P&gt;But when I update the script to the above provided then I am getting only 23 rows.&lt;/P&gt;&lt;P&gt;Going back to the original requirement -&lt;/P&gt;&lt;P&gt;First the script needs to search all the records that it can get by providing -&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myindex" "/app1/service/site/upload failed" AND "source=Web" AND "confirmationNumber=ND_*"&lt;/LI-CODE&gt;&lt;P&gt;Fetch _time, clmNumber, confirmationNumber, and name from that event in the table (4 columns).&lt;BR /&gt;Then check the second line [for same sessionid] for an exception (Exception from executeScript) and provide whatever is after it as a fifth column in the table.&lt;/P&gt;&lt;P&gt;May be I was not clear on the requirements earlier.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 14:45:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-data-from-two-subsequent-events/m-p/677991#M231857</guid>
      <dc:creator>runiyal</dc:creator>
      <dc:date>2024-02-19T14:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Searching data from two subsequent events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-data-from-two-subsequent-events/m-p/678009#M231865</link>
      <description>&lt;P&gt;Now we are deep into the weeds of actual data. &amp;nbsp;The number of rows is dependent only on how many unique &lt;U&gt;claimNumber&lt;/U&gt; regex&amp;nbsp;"&lt;FONT face="courier new,courier"&gt;(?i) claim # *(?&amp;lt;claimNumber&amp;gt;\S+)&lt;/FONT&gt;" extracts from both source filters. &amp;nbsp;A meaningful test would be&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index="myindex" "/app1/service/site/upload failed" AND "source=Web" AND "confirmationNumber=ND_*")
| rex "(?i) claim # *(?&amp;lt;claimNumber&amp;gt;\S+)"
| stats dc(clmNumber) as clmCount dc(claimNumber)claimCount&lt;/LI-CODE&gt;&lt;P&gt;Do they give 23? &amp;nbsp;75? &amp;nbsp;one give 75, one 23? (According to your description, &lt;U&gt;claimCount&lt;/U&gt; should be 23.) &amp;nbsp;If the two counts are equal, there is nothing to change.&lt;/P&gt;&lt;P&gt;If you get different counts for &lt;U&gt;clmNumber&lt;/U&gt; and &lt;U&gt;claimNumber&lt;/U&gt;, you can do another test&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index="myindex" "/app1/service/site/upload failed" AND "source=Web" AND "confirmationNumber=ND_*")
| rex "(?i) claim # *(?&amp;lt;claimNumber&amp;gt;\S+)"
| table _time clmNumber claimNumber _raw&lt;/LI-CODE&gt;&lt;P&gt;Then, you need to refine the regex. &amp;nbsp;Post sample data for which claimNumber is not extracted if you need help with regex.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 20:13:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-data-from-two-subsequent-events/m-p/678009#M231865</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-02-19T20:13:17Z</dc:date>
    </item>
  </channel>
</rss>

