<?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 How to build a query to find the request and response of the main service and sub services in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-query-to-find-the-request-and-response-of-the/m-p/213040#M62460</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a request and response logs for service.here is the question.&lt;BR /&gt;
service A(main service)(id:1111):&lt;BR /&gt;
             ---Internal service1(sub service)(id:1111)&lt;BR /&gt;
            ---internal service 2(sub service)(id:1111)&lt;BR /&gt;
            ----Internal service 3(sub service)(id:1111)&lt;BR /&gt;
Here service A starts and creates a ID and it will execute sub services(1,2,3).Id Remains the same for main and sub services.&lt;BR /&gt;
My requirement is:&lt;/P&gt;

&lt;P&gt;I need to find out the time taken to complete the request and response for each and every main service. If the subservice failed then i should be able to see logs.In the events there is a success codes and failure codes.&lt;/P&gt;

&lt;P&gt;please help with query.&lt;/P&gt;</description>
    <pubDate>Sat, 23 Apr 2016 00:31:55 GMT</pubDate>
    <dc:creator>mprreddy51</dc:creator>
    <dc:date>2016-04-23T00:31:55Z</dc:date>
    <item>
      <title>How to build a query to find the request and response of the main service and sub services</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-query-to-find-the-request-and-response-of-the/m-p/213040#M62460</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a request and response logs for service.here is the question.&lt;BR /&gt;
service A(main service)(id:1111):&lt;BR /&gt;
             ---Internal service1(sub service)(id:1111)&lt;BR /&gt;
            ---internal service 2(sub service)(id:1111)&lt;BR /&gt;
            ----Internal service 3(sub service)(id:1111)&lt;BR /&gt;
Here service A starts and creates a ID and it will execute sub services(1,2,3).Id Remains the same for main and sub services.&lt;BR /&gt;
My requirement is:&lt;/P&gt;

&lt;P&gt;I need to find out the time taken to complete the request and response for each and every main service. If the subservice failed then i should be able to see logs.In the events there is a success codes and failure codes.&lt;/P&gt;

&lt;P&gt;please help with query.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Apr 2016 00:31:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-query-to-find-the-request-and-response-of-the/m-p/213040#M62460</guid>
      <dc:creator>mprreddy51</dc:creator>
      <dc:date>2016-04-23T00:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a query to find the request and response of the main service and sub services</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-query-to-find-the-request-and-response-of-the/m-p/213041#M62461</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;You will want to work with transaction:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Transaction"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Transaction&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Apr 2016 00:39:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-query-to-find-the-request-and-response-of-the/m-p/213041#M62461</guid>
      <dc:creator>guilmxm</dc:creator>
      <dc:date>2016-04-23T00:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a query to find the request and response of the main service and sub services</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-query-to-find-the-request-and-response-of-the/m-p/213042#M62462</link>
      <description>&lt;P&gt;I already did like this but not working:&lt;BR /&gt;
Index=abc sourcetype=pqr service=moper |transaction  id&lt;BR /&gt;
but i am getting all events;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Apr 2016 00:42:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-query-to-find-the-request-and-response-of-the/m-p/213042#M62462</guid>
      <dc:creator>mprreddy51</dc:creator>
      <dc:date>2016-04-23T00:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a query to find the request and response of the main service and sub services</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-query-to-find-the-request-and-response-of-the/m-p/213043#M62463</link>
      <description>&lt;P&gt;transaction is probably part of an answer, transaction will identify and group events depending on fields with values common to events, such as a session id. (which is your use)&lt;/P&gt;

&lt;P&gt;But that's part of the job, you will next want to evaluate the response time per sub_service / id, it's hard to answer really without being in the data, but if you have field extracted, the sub service name and the id, some simple evaluation like (even without transaction)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats avg(myfield) by subservice_fieldname, id_fieldname
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Should start putting you on the right way.&lt;/P&gt;

&lt;P&gt;The stats command will automatically associate the id with sub_service if your fields are correctly extracted.&lt;BR /&gt;
As said earlier, transaction will be useful to group events, its add valuable fields (look at the doc) you may need to use in your search before evaluating the response time for example.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Apr 2016 01:27:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-query-to-find-the-request-and-response-of-the/m-p/213043#M62463</guid>
      <dc:creator>guilmxm</dc:creator>
      <dc:date>2016-04-23T01:27:02Z</dc:date>
    </item>
  </channel>
</rss>

