<?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: Multiple URL's  response time  by URL's in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Multiple-URL-s-response-time-by-URL-s/m-p/288677#M87403</link>
    <description>&lt;P&gt;Thanks Niket ,&lt;BR /&gt;
I have one more query &lt;BR /&gt;
 i am running this below query :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ihs host=losat  sourcetype=ih 
( URLRedefined="/wcs/resources/products/*/credit/fin/v1\?brand=*" OR URLRedefined="/webapp/wcs/OrderItem\?orderId=*")

| eval URL=case(match(URLRedefined,"/wcs/resources/products/*/credit/fin/v1\?brand=*"),"/wcs/resources/products/*/credit/fin/v1?brand=*",
                match(URLRedefined,"/webapp/wcs/OrderItem\?orderId=*"),"/webapp/wcs/OrderItem?orderId=*"  )
| stats count perc95(ResponseTime)  by URL 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am getting stats for the  orderitem url  but for the  credit/fin   url  i am not getting stats  ....i am not getting what is wrong here .&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jul 2017 06:44:38 GMT</pubDate>
    <dc:creator>shabdadev</dc:creator>
    <dc:date>2017-07-06T06:44:38Z</dc:date>
    <item>
      <title>Multiple URL's  response time  by URL's</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-URL-s-response-time-by-URL-s/m-p/288673#M87399</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I have this scenario where i have couple of diff  types of URL's like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/webapp/wcs/services/Key
/webapp/wcs/services/Address
/wcs/resources/v1?*
/webapp/orderId=*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to  write a  query to list down the response time for each url  by url wise like  this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;URL                                                                                    Response time
/webapp/wcs/services/Key                                              50
/webapp/wcs/services/Address                                      30
/wcs/resources/v1?*                                                         25
/webapp/orderId=*                                                           10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I know we can use like  command but like only matches the exact  url  which are starightforward  , if   wildcard  is there its not able to match and hence not showing the stats , how to manipulate the query to get the required result .....i have lot of url's  but only listing  4 here .&lt;BR /&gt;
i wrote the below query but its not returning the data for  the url's containing the wildcards &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ih host=los  sourcetype=ihD 
(URLRedefined="/webapp/wcs/services/Key"   OR
URLRedefined="/webapp/wcs/services/Address"   OR
URLRedefined="/wcs/resources/v1?*"  OR URLRedefined="/webapp/orderId=*"  )
| eval URL=case(like(URLRedefined,"/webapp/wcs/services/Key"),"/webapp/wcs/services/Key",
                like(URLRedefined,"/webapp/wcs/services/Address"),"/webapp/wcs/services/Address",
                like(URLRedefined,"/wcs/resources/v1?*"),"/wcs/resources/v1?*",
                like(URLRedefined,"/webapp/orderId=*"),"/webapp/orderId=*")
|  stats perc95(ResponseTime)  by URL
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Jul 2017 11:22:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-URL-s-response-time-by-URL-s/m-p/288673#M87399</guid>
      <dc:creator>shabdadev</dc:creator>
      <dc:date>2017-07-04T11:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple URL's  response time  by URL's</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-URL-s-response-time-by-URL-s/m-p/288674#M87400</link>
      <description>&lt;P&gt;I have changed from like to &lt;STRONG&gt;match&lt;/STRONG&gt; (&lt;STRONG&gt;like&lt;/STRONG&gt; will return same results). You should escape question mark (&lt;CODE&gt;?&lt;/CODE&gt;) in the match pattern with forward slash. Following is run anywhere search to test your eval statement.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval URLRedefined="/wcs/resources/v1\?*"
| eval URL=case(like(URLRedefined,"/webapp/wcs/services/Key"),"/webapp/wcs/services/Key",
                 like(URLRedefined,"/webapp/wcs/services/Address"),"/webapp/wcs/services/Address",
                 like(URLRedefined,"/wcs/resources/v1\?*"),"/wcs/resources/v1?*",
                 like(URLRedefined,"/webapp/orderId=*"),"/webapp/orderId=*")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval URLRedefined="/wcs/resources/v1\?*"
| eval URL=case(match(URLRedefined,"/webapp/wcs/services/Key"),"/webapp/wcs/services/Key",
                 match(URLRedefined,"/webapp/wcs/services/Address"),"/webapp/wcs/services/Address",
                 match(URLRedefined,"/wcs/resources/v1\?*"),"/wcs/resources/v1?*",
                 match(URLRedefined,"/webapp/orderId=*"),"/webapp/orderId=*")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please try out and let us know.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 11:57:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-URL-s-response-time-by-URL-s/m-p/288674#M87400</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-07-04T11:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple URL's  response time  by URL's</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-URL-s-response-time-by-URL-s/m-p/288675#M87401</link>
      <description>&lt;P&gt;Awesome it worked Niket .&lt;BR /&gt;
One more question : &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;In match its optional or what to give the false condition ??&lt;/LI&gt;
&lt;LI&gt;Why  forward slash  ...why  splunk cant accept  ?   mark  in the query ??&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 04 Jul 2017 12:11:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-URL-s-response-time-by-URL-s/m-p/288675#M87401</guid>
      <dc:creator>shabdadev</dc:creator>
      <dc:date>2017-07-04T12:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple URL's  response time  by URL's</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-URL-s-response-time-by-URL-s/m-p/288676#M87402</link>
      <description>&lt;P&gt;1) With case you can always add either &lt;CODE&gt;1==1&lt;/CODE&gt; or &lt;CODE&gt;true()&lt;/CODE&gt; condition in the end to make sure it handles the default scenario where none of defined tests match.&lt;/P&gt;

&lt;P&gt;For example: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | eval URL=case(match(URLRedefined,"/webapp/wcs/services/Key"),"/webapp/wcs/services/Key",
                  match(URLRedefined,"/webapp/wcs/services/Address"),"/webapp/wcs/services/Address",
                  match(URLRedefined,"/wcs/resources/v1\?*"),"/wcs/resources/v1?*",
                  match(URLRedefined,"/webapp/orderId=*"),"/webapp/orderId=*",
                  true(),"unKnownURL")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2) Depending upon the type of SPL functionality being used and values being passed some characters have different implications hence they need to be escaped (there are different ways of escaping as well). Most common way while dealing with regular expressions, is to add forward slash before a special character. This treats the character as is and override its other meaning. Having said this, in current scenario both &lt;STRONG&gt;like()&lt;/STRONG&gt; and &lt;STRONG&gt;match()&lt;/STRONG&gt; are pattern based where question mark (?) implies field name being extracted. Hence it needs to be escaped. Refer to Regular Expression details on &lt;STRONG&gt;regex101.com&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 12:41:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-URL-s-response-time-by-URL-s/m-p/288676#M87402</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-07-04T12:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple URL's  response time  by URL's</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-URL-s-response-time-by-URL-s/m-p/288677#M87403</link>
      <description>&lt;P&gt;Thanks Niket ,&lt;BR /&gt;
I have one more query &lt;BR /&gt;
 i am running this below query :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ihs host=losat  sourcetype=ih 
( URLRedefined="/wcs/resources/products/*/credit/fin/v1\?brand=*" OR URLRedefined="/webapp/wcs/OrderItem\?orderId=*")

| eval URL=case(match(URLRedefined,"/wcs/resources/products/*/credit/fin/v1\?brand=*"),"/wcs/resources/products/*/credit/fin/v1?brand=*",
                match(URLRedefined,"/webapp/wcs/OrderItem\?orderId=*"),"/webapp/wcs/OrderItem?orderId=*"  )
| stats count perc95(ResponseTime)  by URL 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am getting stats for the  orderitem url  but for the  credit/fin   url  i am not getting stats  ....i am not getting what is wrong here .&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 06:44:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-URL-s-response-time-by-URL-s/m-p/288677#M87403</guid>
      <dc:creator>shabdadev</dc:creator>
      <dc:date>2017-07-06T06:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple URL's  response time  by URL's</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-URL-s-response-time-by-URL-s/m-p/288678#M87404</link>
      <description>&lt;P&gt;@shabdadev, you would need to match only credit URL to test whether the pattern is correct as per the actual URLs. Since we have filtered only two types or URLs even if orderitem URL is working fine for you, you can treat everything else as credit URL.&lt;/P&gt;

&lt;P&gt;However, this is the correct pattern for credit URL&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | eval URL=case(match(URLRedefined,"\/wcs\/resources\/products\/.*\/credit\/fin\/v1\?brand=*"),"/wcs/resources/products/*/credit/fin/v1?brand=*",
                 match(URLRedefined,"/webapp/wcs/OrderItem\?orderId=*"),"/webapp/wcs/OrderItem?orderId=*"  )
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Jul 2017 17:50:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-URL-s-response-time-by-URL-s/m-p/288678#M87404</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-07-07T17:50:45Z</dc:date>
    </item>
  </channel>
</rss>

