<?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: Get list of session id's that did not get a response from web service. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Get-list-of-session-id-s-that-did-not-get-a-response-from-web/m-p/108337#M28200</link>
    <description>&lt;P&gt;Dang I love this product.  There is always a way to do something.&lt;/P&gt;

&lt;P&gt;You were right, I was missing a backslash in front of the S+ expression and that allowed logging of the session id.  Also thanks for suggesting filtering out results before I process them, that speeds up the query quite a bit.&lt;/P&gt;

&lt;P&gt;Then taking what you gave me and slightly tweaking it gave me some useful results.&lt;/P&gt;</description>
    <pubDate>Mon, 29 Jul 2013 23:22:01 GMT</pubDate>
    <dc:creator>phoeniix</dc:creator>
    <dc:date>2013-07-29T23:22:01Z</dc:date>
    <item>
      <title>Get list of session id's that did not get a response from web service.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-list-of-session-id-s-that-did-not-get-a-response-from-web/m-p/108334#M28197</link>
      <description>&lt;P&gt;We are having a problem where requests are being sent to webservices but never return.  I want to get a list of session numbers that sent a request to the webservice (XML Sent to Service) but did not get a response back (XML Response from Services).  The following two lines are from Splunk that indexed our log4j logs of a successful purchase.&lt;/P&gt;

&lt;P&gt;2013-07-26 14:48:45 - DEBUG:4LW5DNw1MdB5Rt5RhFUQCA__ - ExternalProcessManager.sendRequestToServices:(213) | XML Response from Services &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;BR /&gt;
&amp;lt;purchaseresponse haserror="0"&amp;gt;&lt;BR /&gt;
  &amp;lt;price&amp;gt;39.02&amp;lt;/price&amp;gt;&lt;BR /&gt;
  &amp;lt;product&amp;gt;G-200HA&amp;lt;/product&amp;gt;&lt;BR /&gt;
  &amp;lt;actioncode&amp;gt;New&amp;lt;/actioncode&amp;gt;&lt;/P&gt;

&lt;P&gt;Show all 49 lines&lt;/P&gt;

&lt;P&gt;host=CA1CW-WEB01   Options|  sourcetype=log4j   Options|  source=ca1cw-web01\logs\log4j\csatp.2013-07-26.log   Options&lt;/P&gt;

&lt;P&gt;2013-07-26 14:48:45 - DEBUG:4LW5DNw1MdB5Rt5RhFUQCA__ - ExternalProcessManager.sendRequestToServices:(202) | XML Sent to Service http:/oursite.com/quote-rs/purchase: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;BR /&gt;
&amp;lt;request&amp;gt;&amp;lt;purchaserequest&amp;gt;&amp;lt;actioncode&amp;gt;New&amp;lt;/actioncode&amp;gt;&amp;lt;aff&amp;gt;ha&amp;lt;/aff&amp;gt;&amp;lt;producer&amp;gt;HOMERTBO&amp;lt;/producer&amp;gt;&amp;lt;productclass&amp;gt;HOMEAWAYCP&amp;lt;/productclass&amp;gt;&amp;lt;plancode&amp;gt;A1&amp;lt;/plancode&amp;gt;&lt;/P&gt;

&lt;P&gt;Show all 49 lines&lt;/P&gt;

&lt;P&gt;host=CA1CW-WEB01   Options|  sourcetype=log4j   Options|  source=ca1cw-web01\logs\log4j\csatp.2013-07-26.log     &lt;/P&gt;

&lt;P&gt;How could we structure a query that uses rex to get the session number, then search for any session id's that did not log an (XML Response from Services)?  I have tried this query and dont really know where to go from here:&lt;/P&gt;

&lt;P&gt;sourcetype=log4j | rex ":\d\d - \S+:(?&amp;lt;sessionid&amp;gt;\S+) -.*&amp;amp;lt;request&amp;amp;gt;&amp;amp;lt;purchaserequest&amp;amp;gt;" | search &amp;amp;lt;response&amp;amp;gt;&amp;amp;lt;purchaseresponse&amp;amp;gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2013 23:06:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-list-of-session-id-s-that-did-not-get-a-response-from-web/m-p/108334#M28197</guid>
      <dc:creator>phoeniix</dc:creator>
      <dc:date>2013-07-26T23:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Get list of session id's that did not get a response from web service.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-list-of-session-id-s-that-did-not-get-a-response-from-web/m-p/108335#M28198</link>
      <description>&lt;P&gt;I cannot update the original post, keep getting this field is required and all fields are filled in.  The query should be this: sourcetype=log4j | rex "\:\d\d - \S+:(?&lt;SESSIONID&gt;\S+) -.*&amp;lt;purchaserequest&amp;gt;" | search &amp;lt;purchaseresponse&amp;gt;&lt;/SESSIONID&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2013 23:22:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-list-of-session-id-s-that-did-not-get-a-response-from-web/m-p/108335#M28198</guid>
      <dc:creator>phoeniix</dc:creator>
      <dc:date>2013-07-26T23:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Get list of session id's that did not get a response from web service.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-list-of-session-id-s-that-did-not-get-a-response-from-web/m-p/108336#M28199</link>
      <description>&lt;P&gt;First, are you sure that your &lt;CODE&gt;sessionid&lt;/CODE&gt; is extracting properly from both the request and response events?&lt;/P&gt;

&lt;P&gt;Next, this may be closer to what you want...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=log4j "purchaserequest" OR "purchaseresponse"
| rex "\:\d\d - S+:(?&amp;lt;sessionid&amp;gt;S+) -.*&amp;lt;purchaserequest&amp;gt;" 
| eval request=if(match(_raw,"\&amp;lt;purchaserequest\&amp;gt;",1,0)
| eval response=if(match(_raw,"\&amp;lt;purchaseresponse haserror=.*?\&amp;gt;",1,0)
| stats sum(request) as numRequests sum(response) as numReponses by sessionid
| where numRequests &amp;gt; numResponses
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 27 Jul 2013 01:17:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-list-of-session-id-s-that-did-not-get-a-response-from-web/m-p/108336#M28199</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-07-27T01:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get list of session id's that did not get a response from web service.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-list-of-session-id-s-that-did-not-get-a-response-from-web/m-p/108337#M28200</link>
      <description>&lt;P&gt;Dang I love this product.  There is always a way to do something.&lt;/P&gt;

&lt;P&gt;You were right, I was missing a backslash in front of the S+ expression and that allowed logging of the session id.  Also thanks for suggesting filtering out results before I process them, that speeds up the query quite a bit.&lt;/P&gt;

&lt;P&gt;Then taking what you gave me and slightly tweaking it gave me some useful results.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2013 23:22:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-list-of-session-id-s-that-did-not-get-a-response-from-web/m-p/108337#M28200</guid>
      <dc:creator>phoeniix</dc:creator>
      <dc:date>2013-07-29T23:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Get list of session id's that did not get a response from web service.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-list-of-session-id-s-that-did-not-get-a-response-from-web/m-p/108338#M28201</link>
      <description>&lt;P&gt;I am using this query to see by day what sessions had requests without responses:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=log4j "XML Sent to Service" OR "XML Response from Services" 
| search "purchaserequest" OR "purchaseresponse"
| rex "(?&lt;DATE&gt;\d\d\d\d\-\d\d\-\d\d) .* -\s+\S+:(?&lt;SESSIONID&gt;[^ ]+) -.*" 
| eval request=if(match(_raw,"\&lt;PURCHASEREQUEST&gt;"),1,0)
| eval response=if(match(_raw,"\&lt;PURCHASERESPONSE haserror=".*?\"&gt;"),1,0)
| stats sum(request) as numRequests sum(response) as numResponses by date, sessionid
| where numRequests &amp;gt; numResponses
| sort date&lt;/PURCHASERESPONSE&gt;&lt;/PURCHASEREQUEST&gt;&lt;/SESSIONID&gt;&lt;/DATE&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Jul 2013 23:22:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-list-of-session-id-s-that-did-not-get-a-response-from-web/m-p/108338#M28201</guid>
      <dc:creator>phoeniix</dc:creator>
      <dc:date>2013-07-29T23:22:15Z</dc:date>
    </item>
  </channel>
</rss>

