<?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: find request but not in response in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/find-request-but-not-in-response/m-p/650845#M225029</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229311"&gt;@andrew_nelson&lt;/a&gt;, thanks for the quick reply sir. I'd like to extract a few other fields from the request and response (different fields in both, as highlighted below).&lt;/P&gt;&lt;P&gt;[12:30:13 INF 0ceafa153290582e1f1faec3f98d84ac] Gateway API|Request|&lt;STRONG&gt;GET&lt;/STRONG&gt;|...&lt;BR /&gt;[12:30:15 INF 0ceafa153290582e1f1faec3f98d84ac] Gateway API|Response|&lt;STRONG&gt;200&lt;/STRONG&gt;|&lt;STRONG&gt;ProductDetails&lt;/STRONG&gt;|...&lt;/P&gt;&lt;P&gt;I'm not sure how I can make your query do that work and that's why I created the structure that I have. Please let me know how I can get all these done.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jul 2023 14:29:29 GMT</pubDate>
    <dc:creator>nmarun</dc:creator>
    <dc:date>2023-07-17T14:29:29Z</dc:date>
    <item>
      <title>find request but not in response</title>
      <link>https://community.splunk.com/t5/Splunk-Search/find-request-but-not-in-response/m-p/650831#M225025</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;[12:30:13 INF &lt;STRONG&gt;0ceafa153290582e1f1faec3f98d84ac&lt;/STRONG&gt;] Gateway API|Request...&lt;BR /&gt;[12:30:15 INF &lt;STRONG&gt;0ceafa153290582e1f1faec3f98d84ac&lt;/STRONG&gt;] Gateway API|Response...&lt;/P&gt;&lt;P&gt;These are sample request, response structures that we log. There are scenarios where a request might not have a response. I'd like to write a query to find such correlation id (highlighted).&lt;/P&gt;&lt;P&gt;This is something that I tried, but it's fetching all the matches.&lt;/P&gt;&lt;P&gt;index=pcf sourcetype="gateway-api" "Gateway API|Request"&lt;BR /&gt;| rex field=msg "INF ?(?P&amp;lt;correlationId&amp;gt;[a-zA-Z0-9-_, ]*)]"&lt;BR /&gt;| rex field=msg "INF ?(?P&amp;lt;correlationIdReq&amp;gt;[a-zA-Z0-9-_, ]*)]"&lt;BR /&gt;| table correlationId, correlationIdReq&lt;BR /&gt;| join type="left" correlationId&lt;BR /&gt;[search index=pcf sourcetype="gateway-api" "Gateway API|Response"&lt;BR /&gt;| rex field=msg "INF ?(?P&amp;lt;correlationId&amp;gt;[a-zA-Z0-9-_, ]*)]"&lt;BR /&gt;| rex field=msg "INF ?(?P&amp;lt;correlationIdRes&amp;gt;[a-zA-Z0-9-_, ]*)]"&lt;BR /&gt;| table correlationId, correlationIdReq, correlationIdRes]&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 13:28:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/find-request-but-not-in-response/m-p/650831#M225025</guid>
      <dc:creator>nmarun</dc:creator>
      <dc:date>2023-07-17T13:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: find request but not in response</title>
      <link>https://community.splunk.com/t5/Splunk-Search/find-request-but-not-in-response/m-p/650837#M225027</link>
      <description>&lt;P&gt;Try something like this:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=pcf sourcetype="gateway-api" ("Gateway API|Request" OR "Gateway API|Response")
| rex field=msg "INF ?(?P&amp;lt;correlationId&amp;gt;[a-zA-Z0-9-_, ]*)]"
| rex field=msg "Gateway API\|(?&amp;lt;action_type&amp;gt;(Request|Response))"
| stats values(action_type) as action_type by correlationId 
| search action_type!="Response"&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 17 Jul 2023 13:51:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/find-request-but-not-in-response/m-p/650837#M225027</guid>
      <dc:creator>andrew_nelson</dc:creator>
      <dc:date>2023-07-17T13:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: find request but not in response</title>
      <link>https://community.splunk.com/t5/Splunk-Search/find-request-but-not-in-response/m-p/650845#M225029</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229311"&gt;@andrew_nelson&lt;/a&gt;, thanks for the quick reply sir. I'd like to extract a few other fields from the request and response (different fields in both, as highlighted below).&lt;/P&gt;&lt;P&gt;[12:30:13 INF 0ceafa153290582e1f1faec3f98d84ac] Gateway API|Request|&lt;STRONG&gt;GET&lt;/STRONG&gt;|...&lt;BR /&gt;[12:30:15 INF 0ceafa153290582e1f1faec3f98d84ac] Gateway API|Response|&lt;STRONG&gt;200&lt;/STRONG&gt;|&lt;STRONG&gt;ProductDetails&lt;/STRONG&gt;|...&lt;/P&gt;&lt;P&gt;I'm not sure how I can make your query do that work and that's why I created the structure that I have. Please let me know how I can get all these done.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 14:29:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/find-request-but-not-in-response/m-p/650845#M225029</guid>
      <dc:creator>nmarun</dc:creator>
      <dc:date>2023-07-17T14:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: find request but not in response</title>
      <link>https://community.splunk.com/t5/Splunk-Search/find-request-but-not-in-response/m-p/650854#M225032</link>
      <description>&lt;P&gt;You can write two custom extractions, one for each log type. Some rough extractions below.&amp;nbsp;&lt;BR /&gt;The request extraction:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=msg "Gateway API\|Request\|(?&amp;lt;method&amp;gt;[^\|]+)\|(?&amp;lt;field2&amp;gt;[^\|]+)\|(?&amp;lt;field3&amp;gt;[^\|]+)\|(?&amp;lt;field4&amp;gt;[^\|]+)\|(?&amp;lt;field5&amp;gt;[^\|]+)\|..."&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The response extraction:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=msg "Gateway API\|Response\|(?&amp;lt;response_code&amp;gt;\d+)\|(?&amp;lt;field2&amp;gt;[^\|]+)\|(?&amp;lt;field3&amp;gt;[^\|]+)\|(?&amp;lt;field4&amp;gt;[^\|]+)\|(?&amp;lt;field5&amp;gt;[^\|]+)\|..."&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So assuming all of your fields are pipe separated ( | ) these extractions, will pull fields out for everything between the pipe symbol. You can rename the field2, field3 etc to what they actually are.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;If your dataset is actual event data, then its best to create those into proper field extractions that don't need to be created for every individual search.&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 14:53:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/find-request-but-not-in-response/m-p/650854#M225032</guid>
      <dc:creator>andrew_nelson</dc:creator>
      <dc:date>2023-07-17T14:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: find request but not in response</title>
      <link>https://community.splunk.com/t5/Splunk-Search/find-request-but-not-in-response/m-p/650861#M225034</link>
      <description>&lt;P&gt;First and foremost - don't use the "join" command unless you absolutely cannot avoid it.&lt;/P&gt;&lt;P&gt;In this case there's another command which you could use but it's also a "bad one" - it's "transaction".&lt;/P&gt;&lt;P&gt;But I supposed the "lightest" solution here would be to extract the correlationId as you did, extract the type of the call (Request/Response) and then do&lt;/P&gt;&lt;PRE&gt;| stats values(call) by correlationId&lt;/PRE&gt;&lt;P&gt;Then you can find only those which do not have responses&lt;/P&gt;&lt;PRE&gt;| where NOT call="Response"&lt;/PRE&gt;&lt;P&gt;(mind you that it's &lt;U&gt;not&lt;/U&gt; the same as call!="Response")&lt;/P&gt;&lt;P&gt;Of course if you want to get some details of the requests, there will be more magic needed.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 16:01:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/find-request-but-not-in-response/m-p/650861#M225034</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-07-17T16:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: find request but not in response</title>
      <link>https://community.splunk.com/t5/Splunk-Search/find-request-but-not-in-response/m-p/650904#M225049</link>
      <description>&lt;P&gt;Shoot.. I should've thought of that.&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229311"&gt;@andrew_nelson&lt;/a&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 05:27:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/find-request-but-not-in-response/m-p/650904#M225049</guid>
      <dc:creator>nmarun</dc:creator>
      <dc:date>2023-07-18T05:27:17Z</dc:date>
    </item>
  </channel>
</rss>

