<?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: First and Last event of Transaction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/First-and-Last-event-of-Transaction/m-p/488927#M136559</link>
    <description>&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=temp ("SoapMessage" "GetCustomerRequest") OR ("SoapMessage" "GetCustomerResponse")
| rex field=_raw "\&amp;gt;(?[^\&amp;lt;]+)\&amp;lt;\/\w+?\:requestID\&amp;gt;"
| transaction requestID startswith="GetCustomerRequest" endswith="GetCustomerResponse" keepevicted=true mvlist=true
| search eventcount &amp;gt; 1
| eval  last_response=mvindex(response, -1)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 09 Mar 2020 14:48:45 GMT</pubDate>
    <dc:creator>xavierashe</dc:creator>
    <dc:date>2020-03-09T14:48:45Z</dc:date>
    <item>
      <title>First and Last event of Transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/First-and-Last-event-of-Transaction/m-p/488926#M136558</link>
      <description>&lt;P&gt;Hi, I am working on a query where I need to join some events using a transaction command in Splunk. Below is my query where I am joining a particular web service request with a response using a "requestID" and then extracting the data. Now what happens is if the response contains an error, it will again try and may be next time it gets success. requestID remains same here.&lt;BR /&gt;
Right now this query is just using the 1st response event which it encounters and reported as error even if it is not.&lt;/P&gt;

&lt;P&gt;How do i extract the last of the responses so that i get the updated data whether it resulted in an error or success.&lt;/P&gt;

&lt;P&gt;index=temp ("SoapMessage" "GetCustomerRequest") OR ("SoapMessage" "GetCustomerResponse") &lt;BR /&gt;
| rex field=_raw "&amp;gt;(?[^&amp;lt;]+)&amp;lt;\/\w+?:requestID&amp;gt;" &lt;BR /&gt;
| transaction requestID startswith="GetCustomerRequest" endswith="GetCustomerResponse" keepevicted=true &lt;BR /&gt;
| search eventcount &amp;gt; 1&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 12:43:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/First-and-Last-event-of-Transaction/m-p/488926#M136558</guid>
      <dc:creator>Shashank_87</dc:creator>
      <dc:date>2020-03-09T12:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: First and Last event of Transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/First-and-Last-event-of-Transaction/m-p/488927#M136559</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=temp ("SoapMessage" "GetCustomerRequest") OR ("SoapMessage" "GetCustomerResponse")
| rex field=_raw "\&amp;gt;(?[^\&amp;lt;]+)\&amp;lt;\/\w+?\:requestID\&amp;gt;"
| transaction requestID startswith="GetCustomerRequest" endswith="GetCustomerResponse" keepevicted=true mvlist=true
| search eventcount &amp;gt; 1
| eval  last_response=mvindex(response, -1)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Mar 2020 14:48:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/First-and-Last-event-of-Transaction/m-p/488927#M136559</guid>
      <dc:creator>xavierashe</dc:creator>
      <dc:date>2020-03-09T14:48:45Z</dc:date>
    </item>
  </channel>
</rss>

