<?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 Why the error capturing using regex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-the-error-capturing-using-regex/m-p/632390#M219679</link>
    <description>&lt;P&gt;Hi All&lt;BR /&gt;i have been trying to capture the error split up and ratio from the following sample log event which probably needs a complex regex&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{ [-]
   cluster_id: us-prod-az-200
   kubernetes: { [+]
   }
   log: { [-]
     appVersion: 0.1.326
     envType: prod
     environment: prod-txn
     log: Request and Response, consumerId=xxxxxx-xxxx-xxxx, duration=144, correlationId=0-0-0, requestType=ItemDetails, requestIds=43947812:212001513:217953998:55079684:748708658:42068997:16875745:392480759:138021380:49984819:3933145:54016598:500257082:702903612:50179695:54056450, reqOfferIds=,requestPrimaryMap=, storeIds=0000, status=PARTIAL, responseSize=16, isCustomerAddressPresent=true, extPostalCode=null, fulfillmentIntent=, error=138021380=404.IMS.STORE100;500.IMS.PRICE.103:42068997=400.IMS.STORE.100:3933145=500.IMS.OFFER.100;404.IMS.PRICE.103:212001513=404.IMS.STORE.100:217953998=404.IMS.STORE.100;400.IMS.100:500257082=404.IMS.STORE.100, missingBadgeItems=138021380:702903612:55079684:49984819:54056450:3933145:217953998:392480759,  pickupStoreIds= 
     logLine: 93
     methodName: Utils
     serverName: 11.16.251.37
     time: 2023-02-27 14:43:33.999
     timeStamp: 1677509013999
     type: INFO
   }
   time: 2023-02-27T14:43:33.999844088Z&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=""&gt;each event is unique with error attribute is multivalued field with delimiters for each id(only incase of error) or null as shown below,&lt;BR /&gt;ex:&amp;nbsp;&amp;nbsp;error=138021380=404.IMS.STORE100;500.IMS.PRICE.103:42068997=400.IMS.STORE.100:3933145=500.IMS.OFFER.100;404.IMS.PRICE.103:212001513=404.IMS.STORE.100:217953998=404.IMS.STORE.100;400.IMS.100:500257082=404.IMS.STORE.100,&lt;/P&gt;
&lt;P class=""&gt;OR&lt;/P&gt;
&lt;P class=""&gt;error=,&lt;/P&gt;
&lt;P class=""&gt;my requirement is to compute each error code splitup and error ratio in a tabular fashion&lt;/P&gt;
&lt;P class=""&gt;ratio=each error code count/total responseSize&lt;/P&gt;
&lt;P class=""&gt;here responseSize is the number of ids passed in each request per event&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;error&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;count&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="25px"&gt;responseSize&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="25px"&gt;ratio&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="47px"&gt;
&lt;P class=""&gt;404.IMS.STORE100&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="47px"&gt;aggregation of the error&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;aggregate of responseSize&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;round((count/responseSize)*100,2)&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;500.IMS.PRICE.103&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;aggregation of the error&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="25px"&gt;aggregate of responseSize&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P class=""&gt;can someone please help to find a better way to have the error breakdown with ratio as per the above requirement&lt;/P&gt;
&lt;P class=""&gt;i was trying to segregate the error split up and aggregating the responseSize but the search is not giving expected results while tabulating,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=&amp;lt;index name&amp;gt; "log.envType"=prod "log.methodName”=“Utils”   
| rex field=_raw "responseSize=*(?&amp;lt;responseSize&amp;gt;.+?)," 
| rex field=_raw ", error=*(?&amp;lt;errorMap&amp;gt;.+), missingBadgeItems"
| eval errors0=replace(errorMap, "=", ";")
| eval errors1=split(errors0,":")
| rex field=errors1 "(?&amp;lt;errorCodes&amp;gt;.*)"
| mvexpand errorCodes
| eval code=split(errorCodes, ";")
| mvexpand code
| table code,responseSize &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=""&gt;can someone please help..Thanks&amp;nbsp;&lt;/P&gt;
&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Feb 2023 18:24:12 GMT</pubDate>
    <dc:creator>kumar497</dc:creator>
    <dc:date>2023-02-27T18:24:12Z</dc:date>
    <item>
      <title>Why the error capturing using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-the-error-capturing-using-regex/m-p/632390#M219679</link>
      <description>&lt;P&gt;Hi All&lt;BR /&gt;i have been trying to capture the error split up and ratio from the following sample log event which probably needs a complex regex&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{ [-]
   cluster_id: us-prod-az-200
   kubernetes: { [+]
   }
   log: { [-]
     appVersion: 0.1.326
     envType: prod
     environment: prod-txn
     log: Request and Response, consumerId=xxxxxx-xxxx-xxxx, duration=144, correlationId=0-0-0, requestType=ItemDetails, requestIds=43947812:212001513:217953998:55079684:748708658:42068997:16875745:392480759:138021380:49984819:3933145:54016598:500257082:702903612:50179695:54056450, reqOfferIds=,requestPrimaryMap=, storeIds=0000, status=PARTIAL, responseSize=16, isCustomerAddressPresent=true, extPostalCode=null, fulfillmentIntent=, error=138021380=404.IMS.STORE100;500.IMS.PRICE.103:42068997=400.IMS.STORE.100:3933145=500.IMS.OFFER.100;404.IMS.PRICE.103:212001513=404.IMS.STORE.100:217953998=404.IMS.STORE.100;400.IMS.100:500257082=404.IMS.STORE.100, missingBadgeItems=138021380:702903612:55079684:49984819:54056450:3933145:217953998:392480759,  pickupStoreIds= 
     logLine: 93
     methodName: Utils
     serverName: 11.16.251.37
     time: 2023-02-27 14:43:33.999
     timeStamp: 1677509013999
     type: INFO
   }
   time: 2023-02-27T14:43:33.999844088Z&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=""&gt;each event is unique with error attribute is multivalued field with delimiters for each id(only incase of error) or null as shown below,&lt;BR /&gt;ex:&amp;nbsp;&amp;nbsp;error=138021380=404.IMS.STORE100;500.IMS.PRICE.103:42068997=400.IMS.STORE.100:3933145=500.IMS.OFFER.100;404.IMS.PRICE.103:212001513=404.IMS.STORE.100:217953998=404.IMS.STORE.100;400.IMS.100:500257082=404.IMS.STORE.100,&lt;/P&gt;
&lt;P class=""&gt;OR&lt;/P&gt;
&lt;P class=""&gt;error=,&lt;/P&gt;
&lt;P class=""&gt;my requirement is to compute each error code splitup and error ratio in a tabular fashion&lt;/P&gt;
&lt;P class=""&gt;ratio=each error code count/total responseSize&lt;/P&gt;
&lt;P class=""&gt;here responseSize is the number of ids passed in each request per event&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;error&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;count&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="25px"&gt;responseSize&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="25px"&gt;ratio&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="47px"&gt;
&lt;P class=""&gt;404.IMS.STORE100&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="47px"&gt;aggregation of the error&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;aggregate of responseSize&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;round((count/responseSize)*100,2)&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;500.IMS.PRICE.103&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;aggregation of the error&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="25px"&gt;aggregate of responseSize&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P class=""&gt;can someone please help to find a better way to have the error breakdown with ratio as per the above requirement&lt;/P&gt;
&lt;P class=""&gt;i was trying to segregate the error split up and aggregating the responseSize but the search is not giving expected results while tabulating,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=&amp;lt;index name&amp;gt; "log.envType"=prod "log.methodName”=“Utils”   
| rex field=_raw "responseSize=*(?&amp;lt;responseSize&amp;gt;.+?)," 
| rex field=_raw ", error=*(?&amp;lt;errorMap&amp;gt;.+), missingBadgeItems"
| eval errors0=replace(errorMap, "=", ";")
| eval errors1=split(errors0,":")
| rex field=errors1 "(?&amp;lt;errorCodes&amp;gt;.*)"
| mvexpand errorCodes
| eval code=split(errorCodes, ";")
| mvexpand code
| table code,responseSize &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=""&gt;can someone please help..Thanks&amp;nbsp;&lt;/P&gt;
&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 18:24:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-the-error-capturing-using-regex/m-p/632390#M219679</guid>
      <dc:creator>kumar497</dc:creator>
      <dc:date>2023-02-27T18:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Why the error capturing using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-the-error-capturing-using-regex/m-p/632436#M219694</link>
      <description>&lt;P&gt;You can try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "error=(?&amp;lt;error&amp;gt;[^,]*)"
| eval errors=split(error, ":")
| rex "responseSize=(?&amp;lt;responseSize&amp;gt;\d+)"
| table error errors responseSize
| rex max_match=0 field=errors "^(?&amp;lt;requestId&amp;gt;\d+)=(?&amp;lt;errorCodes&amp;gt;.*)"
| fields - error errors
| eval errorCodes=mvmap(errorCodes, split(errorCodes, ";"))
| stats count avg(responseSize) by errorCodes&lt;/LI-CODE&gt;&lt;P&gt;although that will only get you part of the way, as I'm not clear what your response size needs to be. In your example, there are 3 instances of&amp;nbsp;&lt;SPAN&gt;404.IMS.STORE.100 and if you have another event with 2 instances, where the responseSize is 10, what would you want to see in terms of your responseSize field and ratios?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 22:36:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-the-error-capturing-using-regex/m-p/632436#M219694</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-02-27T22:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why the error capturing using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-the-error-capturing-using-regex/m-p/632463#M219702</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;responseSize attribute is the num of items passed in each request , im considering this field to compute the errorcode % across the overall items passed for that duration&lt;BR /&gt;&lt;BR /&gt;exampe if an event have&amp;nbsp;&lt;SPAN&gt;404.IMS.STORE.100 error thrice(three items) out of 10 items , i would like aggregate each such instance across the aggregation of total items for the time duration , this should include the events with responseSize that has no errors so that overall items count are covered while ratio&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1st event with 3 error instances&amp;nbsp;&lt;SPAN&gt;404.IMS.STORE.100 with responseSize=10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2nd event with 5 error instances&amp;nbsp;404.IMS.STORE.100 with responseSize=25&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;expected ratio per error (3+5)/(10+15)&lt;BR /&gt;&lt;BR /&gt;Im stuck while mapping the error instances count and the total responseSize count while computing the ratio in a streaming fashion as it works individually while doing stats&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 02:43:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-the-error-capturing-using-regex/m-p/632463#M219702</guid>
      <dc:creator>kumar497</dc:creator>
      <dc:date>2023-02-28T02:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why the error capturing using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-the-error-capturing-using-regex/m-p/632466#M219704</link>
      <description>&lt;P&gt;Here is a runnable example using a sample of the data you gave.&amp;nbsp;&lt;/P&gt;&lt;P&gt;See if this is doing the right thing for you -&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval x=split("
     log: Request and Response, consumerId=xxxxxx-xxxx-xxxx, duration=144, correlationId=0-0-0, requestType=ItemDetails, requestIds=43947812:212001513:217953998:55079684:748708658:42068997:16875745:392480759:138021380:49984819:3933145:54016598:500257082:702903612:50179695:54056450, reqOfferIds=,requestPrimaryMap=, storeIds=0000, status=PARTIAL, responseSize=16, isCustomerAddressPresent=true, extPostalCode=null, fulfillmentIntent=, error=138021380=404.IMS.STORE.100;500.IMS.PRICE.103:42068997=400.IMS.STORE.100:3933145=500.IMS.OFFER.100;404.IMS.PRICE.103:212001513=404.IMS.STORE.100:217953998=404.IMS.STORE.100;400.IMS.100:500257082=404.IMS.STORE.100, missingBadgeItems=138021380:702903612:55079684:49984819:54056450:3933145:217953998:392480759,  pickupStoreIds= 
###
     log: Request and Response, consumerId=xxxxxx-xxxx-xxxx, duration=144, correlationId=0-0-0, requestType=ItemDetails, requestIds=43947812:212001513:217953998:55079684:748708658:42068997:16875745:392480759:138021380:49984819, reqOfferIds=,requestPrimaryMap=, storeIds=0000, status=PARTIAL, responseSize=10, isCustomerAddressPresent=true, extPostalCode=null, fulfillmentIntent=, error=138021380=404.IMS.STORE.100;500.IMS.PRICE.103:42068997=400.IMS.STORE.100:3933145=500.IMS.OFFER.100;404.IMS.PRICE.103:212001513=404.IMS.STORE.100:217953998=404.IMS.STORE.100;400.IMS.100, missingBadgeItems=138021380:702903612:55079684:49984819:54056450:3933145:217953998:392480759,  pickupStoreIds= 
###
     log: Request and Response, consumerId=xxxxxx-xxxx-xxxx, duration=144, correlationId=0-0-0, requestType=ItemDetails, requestIds=42068997:138021380, reqOfferIds=,requestPrimaryMap=, storeIds=0000, status=PARTIAL, responseSize=3, isCustomerAddressPresent=true, extPostalCode=null, fulfillmentIntent=, error=138021380=404.IMS.STORE.100;500.IMS.PRICE.103:42068997=400.IMS.STORE.100, missingBadgeItems=138021380:702903612:55079684:49984819:54056450:3933145:217953998:392480759,  pickupStoreIds= 
", "##")
| mvexpand x 
| rename x as _raw
``` THIS IS THE LOGIC FROM HERE DOWN ```
| rex "error=(?&amp;lt;error&amp;gt;[^,]*)"
| eval errors=split(error, ":")
| rex "responseSize=(?&amp;lt;responseSize&amp;gt;\d+)"
| table error errors responseSize
| rex max_match=0 field=errors "^(?&amp;lt;requestId&amp;gt;\d+)=(?&amp;lt;errorCodes&amp;gt;.*)"
| fields - error errors
| eval errorCodes=mvmap(errorCodes, split(errorCodes, ";"))
``` Create a temporary event 'id' ```
| streamstats c as e
``` Count the error codes per event ```
| stats count by errorCodes responseSize e
``` Now get total error code count and total response size for the error codes
| stats sum(count) as error_count sum(responseSize) as responseSize by errorCodes
``` Calculate ratio ```
| eval ratio = round(error_count / responseSize * 100, 2)
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 03:02:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-the-error-capturing-using-regex/m-p/632466#M219704</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-02-28T03:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Why the error capturing using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-the-error-capturing-using-regex/m-p/632467#M219705</link>
      <description>&lt;P&gt;If there is a unique ID you can use instead of streamstats c as e, then use that. e.g. you have a correlation id in the body - is that unique - if so, extract it and replace the&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| streamstats c as e
| stats count by errorCodes responseSize e&lt;/LI-CODE&gt;&lt;P&gt;with just&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats count by errorCodes responseSize YOUR_ID&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 28 Feb 2023 03:04:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-the-error-capturing-using-regex/m-p/632467#M219705</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-02-28T03:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why the error capturing using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-the-error-capturing-using-regex/m-p/632471#M219707</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp; tried the above approach but in certain error cases the ratio showing 100%&amp;nbsp;&lt;/P&gt;&lt;P&gt;ideally aggregation of responseSize per event&amp;nbsp; be a single unique value isnt it for a time window,&lt;BR /&gt;Is it possible to multiple (1/aggregatedvalue of all items size) * (error_count per errorcode) in this usecase&amp;nbsp;&lt;BR /&gt;Also streamstats can be used after error splitting? because responseSize count for non error events has to be also included to compute overall items count, please correct me if im wrong&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 03:57:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-the-error-capturing-using-regex/m-p/632471#M219707</guid>
      <dc:creator>kumar497</dc:creator>
      <dc:date>2023-02-28T03:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Why the error capturing using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-the-error-capturing-using-regex/m-p/632495#M219714</link>
      <description>&lt;P&gt;I don't understand what you are trying to achieve.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you can give an example with your data of numbers you would expect to see under certain conditions, but I don't know your data well enough to know what your desired outcome is.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 07:36:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-the-error-capturing-using-regex/m-p/632495#M219714</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-02-28T07:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why the error capturing using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-the-error-capturing-using-regex/m-p/632601#M219759</link>
      <description>&lt;P&gt;log event is as shown in the above thread&lt;/P&gt;&lt;P&gt;in my log event the error field is logged with multiple error codes for different item ids or no errors yet all in each event as shown below and&amp;nbsp; requirement is to get each error code split up with percentages&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;error=138021380=404.IMS.STORE.100;500.IMS.PRICE.103:42068997=400.IMS.STORE.100&lt;/PRE&gt;&lt;P&gt;number of itemids passed in each request is logged under responseSize field which is been extracted&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;responseSize=3&lt;/PRE&gt;&lt;P&gt;So each event has different instances of errors and responseSize for&amp;nbsp; example in a event there is 3 items passed but two items has 3 different error codes as above similarly another event has different instances of errors or no errors with different item size ,so&amp;nbsp; i would like to compute error ratio like&lt;/P&gt;&lt;P&gt;ratio = (each type of error code count)/(total num of items in all events)&lt;/P&gt;&lt;P&gt;each type error code count = (event1 no of times (&lt;SPAN&gt;404.IMS.STORE.100)&amp;nbsp; +event2 no of times(404.IMS.STORE.100) +...+eventN no of times (404.IMS.STORE.100))&lt;BR /&gt;&lt;BR /&gt;second error code count = (event1 no of times (500.IMS.PRICE.103) +event2 no of times (500.IMS.PRICE.103) +...+eventN no of times(500.IMS.PRICE.103))&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;total no of items = (event1responseSize1+event2responseSize2+.....+eventNresponseSizeN)&lt;/P&gt;&lt;P&gt;Note: responseSize has to be considered for all events not only error related as errorcode % is determined on all the item size from all events&amp;nbsp;&lt;/P&gt;&lt;P&gt;expected output&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;error&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;errorcount&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;total_items&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;errorratio&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;SPAN&gt;404.IMS.STORE.100&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;example 62 times&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;example&amp;nbsp; 14577(total items count)&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;62/14577&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;&lt;SPAN&gt;400.IMS.OFFER.103&lt;BR /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;example 54 times&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;example&amp;nbsp; 14577(total items count)&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;54/14577&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;SPAN&gt;500.IMS.PRICE.103&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;example 77 times&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&amp;nbsp;example&amp;nbsp; 14577(total items count)&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;77/14577&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so basically all different error code split up with ratio of those error percentages is the expected outcome, hope i am able to present clearly&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 14:33:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-the-error-capturing-using-regex/m-p/632601#M219759</guid>
      <dc:creator>kumar497</dc:creator>
      <dc:date>2023-02-28T14:33:26Z</dc:date>
    </item>
  </channel>
</rss>

