<?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: How to extract an endpoint until certain value and not the complete route? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-an-endpoint-until-certain-value-and-not-the/m-p/462298#M130320</link>
    <description>&lt;P&gt;It worked perfectly thanks, is this still doing something in the search "| regex Endpoint="^\W\D+\w.\D+" ? because I tried this regular expression and worked but didn't cut the rest of the endpoint like yours did, "| rex field=Endpoint "(?\/\w+\/\w+\/\w+)", can you break it down for me en explain it? thank you so much&lt;/P&gt;</description>
    <pubDate>Wed, 05 Feb 2020 18:17:12 GMT</pubDate>
    <dc:creator>dnavia29</dc:creator>
    <dc:date>2020-02-05T18:17:12Z</dc:date>
    <item>
      <title>How to extract an endpoint until certain value and not the complete route?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-an-endpoint-until-certain-value-and-not-the/m-p/462296#M130318</link>
      <description>&lt;P&gt;Hello, I am trying to simplify a search in Splunk taking only my principal endpoints and not the detail transactions, I am using regex to filter this but it still show me all the details, what I want to see is the availability of the endpoint and not separated for transaction. &lt;BR /&gt;
here is my query.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
sourcetype="api-core" &lt;BR /&gt;
          | rename request.body{}.value.request.http_status_code as http_req_result &lt;BR /&gt;
          | convert num(http_req_result) as http_res &lt;BR /&gt;
          | where http_res &amp;gt; 0 &lt;BR /&gt;
          | rename http_res as "RequestStatus", request.body{}.value.request.endpoint as Endpoint &lt;BR /&gt;
          | regex Endpoint="^\W\D+\w.\D+" &lt;BR /&gt;
          | stats count(eval(RequestStatus&amp;gt;0)) as total, count(eval(RequestStatus&amp;gt;200)) as errors by Endpoint &lt;BR /&gt;
          | eval disponibilidad=(100-(errors/total*100)) &lt;BR /&gt;
          | eval disponibilidad = round(disponibilidad,0)&lt;BR /&gt;
          | table Endpoint, disponibilidad&lt;BR /&gt;
          | sort disponibilidad&lt;BR /&gt;
&lt;/CODE&gt;&lt;BR /&gt;
This returns in this result&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
/accounts/v1/credit_lines/0205087584/transactions   0&lt;BR /&gt;
/accounts/v1/credit_lines/0205202927/transactions   0&lt;BR /&gt;
/accounts/v1/credit_lines/0207414358/transactions   0&lt;BR /&gt;
/accounts/v1/credit_lines/0207440484/transactions   0&lt;BR /&gt;
/accounts/v1/credit_lines/0209367114/transactions   0&lt;BR /&gt;
/accounts/v1/credit_lines/0210909021/transactions   0&lt;BR /&gt;
/accounts/v1/credit_lines/0210997318/transactions   0&lt;BR /&gt;
/accounts/v1/credit_lines/0211293790/transactions   0&lt;BR /&gt;
/accounts/v1/credit_lines/0213211449/transactions   0&lt;BR /&gt;
/accounts/v1/credit_lines/0213285496/transactions   0&lt;BR /&gt;
/accounts/v1/credit_lines/0213523143/transactions   0&lt;BR /&gt;
/accounts/v1/credit_lines/0214261457/transactions   0&lt;BR /&gt;
/authentication/v1/mfa/168831676/otp    0&lt;BR /&gt;
/clients/v1/clients/165839218/reward_points 0&lt;BR /&gt;
/clients/v1/clients/121049368   50&lt;BR /&gt;
/clients/v1/clients/166947472&lt;BR /&gt;
&lt;/CODE&gt;&lt;BR /&gt;
What I want is to group by endpoint, example "/accounts/v1/credit_lines", "/authentication/v1/mfa", "/clients/v1/clients/" and see all the transactions, not separated. &lt;/P&gt;

&lt;P&gt;Please your help, Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 16:28:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-an-endpoint-until-certain-value-and-not-the/m-p/462296#M130318</guid>
      <dc:creator>dnavia29</dc:creator>
      <dc:date>2020-02-05T16:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract an endpoint until certain value and not the complete route?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-an-endpoint-until-certain-value-and-not-the/m-p/462297#M130319</link>
      <description>&lt;P&gt;This should help.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="api-core" 
| rename request.body{}.value.request.http_status_code as http_req_result 
| convert num(http_req_result) as http_res 
| where http_res &amp;gt; 0 
| rename http_res as "RequestStatus", request.body{}.value.request.endpoint as Endpoint 
| regex Endpoint="^\W\D+\w.\D+" 
| rex field=Endpoint "(?&amp;lt;ep&amp;gt;\/\w+\/\w+\/\w+)"
| stats count(eval(RequestStatus&amp;gt;0)) as total, count(eval(RequestStatus&amp;gt;200)) as errors by ep
| eval disponibilidad=(100-(errors/total*100)) 
| eval disponibilidad = round(disponibilidad,0) 
| rename ep as Endpoint
| table Endpoint, disponibilidad 
| sort disponibilidad
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Feb 2020 17:50:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-an-endpoint-until-certain-value-and-not-the/m-p/462297#M130319</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-02-05T17:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract an endpoint until certain value and not the complete route?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-an-endpoint-until-certain-value-and-not-the/m-p/462298#M130320</link>
      <description>&lt;P&gt;It worked perfectly thanks, is this still doing something in the search "| regex Endpoint="^\W\D+\w.\D+" ? because I tried this regular expression and worked but didn't cut the rest of the endpoint like yours did, "| rex field=Endpoint "(?\/\w+\/\w+\/\w+)", can you break it down for me en explain it? thank you so much&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 18:17:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-an-endpoint-until-certain-value-and-not-the/m-p/462298#M130320</guid>
      <dc:creator>dnavia29</dc:creator>
      <dc:date>2020-02-05T18:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract an endpoint until certain value and not the complete route?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-an-endpoint-until-certain-value-and-not-the/m-p/462299#M130321</link>
      <description>&lt;P&gt;The &lt;CODE&gt;regex&lt;/CODE&gt; command is a filter.  It merely allows or blocks events based on the provided regular expression.&lt;BR /&gt;
The &lt;CODE&gt;rex&lt;/CODE&gt; command is for field extraction ("cutting").  It also uses regular expressions, but any named capture groups in the regex become fields in the event.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 19:53:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-an-endpoint-until-certain-value-and-not-the/m-p/462299#M130321</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-02-05T19:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract an endpoint until certain value and not the complete route?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-an-endpoint-until-certain-value-and-not-the/m-p/462300#M130322</link>
      <description>&lt;P&gt;Ok I understand, thank you so much for your help &lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 20:24:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-an-endpoint-until-certain-value-and-not-the/m-p/462300#M130322</guid>
      <dc:creator>dnavia29</dc:creator>
      <dc:date>2020-02-05T20:24:20Z</dc:date>
    </item>
  </channel>
</rss>

